Skip to content

Commit

Permalink
Actually fix animated images
Browse files Browse the repository at this point in the history
  • Loading branch information
jobobby04 committed Mar 18, 2024
1 parent 0767526 commit fb16491
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ open class ReaderPageImageView @JvmOverloads constructor(
.diskCachePolicy(CachePolicy.DISABLED)
.target(
onSuccess = { result ->
setImageDrawable(result.asDrawable(context.resources))
(result as? Animatable)?.start()
val drawable = result.asDrawable(context.resources)
setImageDrawable(drawable)
(drawable as? Animatable)?.start()
isVisible = true
this@ReaderPageImageView.onImageLoaded()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ object ImageUtil {
// Coil supports animated WebP on Android 9.0+
// https://coil-kt.github.io/coil/getting_started/#supported-image-formats
Format.Webp -> type.isAnimated && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
// Coil supports animated Heif on Android 11+
// https://coil-kt.github.io/coil/getting_started/#supported-image-formats
Format.Heif -> type.isAnimated && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
else -> false
}
} catch (e: Exception) {
Expand Down

0 comments on commit fb16491

Please sign in to comment.