Skip to content

Commit

Permalink
Fix java.lang.ClassCastException: android.graphics.Bitmap cannot be c…
Browse files Browse the repository at this point in the history
…ast to android.graphics.drawable.Drawable
  • Loading branch information
YvesCheung committed Jan 14, 2022
1 parent 98a3fef commit fbbd13e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal class SVGAImageViewTargetFactory : ImageViewTargetFactory() {

@Suppress("UNCHECKED_CAST")
override fun <Z : Any> buildTarget(view: ImageView, clazz: Class<Z>): ViewTarget<ImageView, Z> {
if (view is SVGAImageView) {
if (view is SVGAImageView && Drawable::class.java.isAssignableFrom(clazz)) {
return SVGADrawableImageViewTarget(view) as ViewTarget<ImageView, Z>
}
return super.buildTarget(view, clazz)
Expand Down

0 comments on commit fbbd13e

Please sign in to comment.