Actually fix animated images
This commit is contained in:
parent
0767526f18
commit
fb1649125c
@ -343,8 +343,9 @@ open class ReaderPageImageView @JvmOverloads constructor(
|
|||||||
.diskCachePolicy(CachePolicy.DISABLED)
|
.diskCachePolicy(CachePolicy.DISABLED)
|
||||||
.target(
|
.target(
|
||||||
onSuccess = { result ->
|
onSuccess = { result ->
|
||||||
setImageDrawable(result.asDrawable(context.resources))
|
val drawable = result.asDrawable(context.resources)
|
||||||
(result as? Animatable)?.start()
|
setImageDrawable(drawable)
|
||||||
|
(drawable as? Animatable)?.start()
|
||||||
isVisible = true
|
isVisible = true
|
||||||
this@ReaderPageImageView.onImageLoaded()
|
this@ReaderPageImageView.onImageLoaded()
|
||||||
},
|
},
|
||||||
|
@ -91,6 +91,9 @@ object ImageUtil {
|
|||||||
// Coil supports animated WebP on Android 9.0+
|
// Coil supports animated WebP on Android 9.0+
|
||||||
// https://coil-kt.github.io/coil/getting_started/#supported-image-formats
|
// https://coil-kt.github.io/coil/getting_started/#supported-image-formats
|
||||||
Format.Webp -> type.isAnimated && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
|
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
|
else -> false
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user