Skip to content

Commit 2f7617d

Browse files
jobobby04cuong-tran
authored andcommitted
Actually fix animated images
1 parent 2708dde commit 2f7617d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,9 @@ open class ReaderPageImageView @JvmOverloads constructor(
343343
.diskCachePolicy(CachePolicy.DISABLED)
344344
.target(
345345
onSuccess = { result ->
346-
setImageDrawable(result.asDrawable(context.resources))
347-
(result as? Animatable)?.start()
346+
val drawable = result.asDrawable(context.resources)
347+
setImageDrawable(drawable)
348+
(drawable as? Animatable)?.start()
348349
isVisible = true
349350
this@ReaderPageImageView.onImageLoaded()
350351
},

core/common/src/main/kotlin/tachiyomi/core/common/util/system/ImageUtil.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ object ImageUtil {
9191
// Coil supports animated WebP on Android 9.0+
9292
// https://coil-kt.github.io/coil/getting_started/#supported-image-formats
9393
Format.Webp -> type.isAnimated && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
94+
// Coil supports animated Heif on Android 11+
95+
// https://coil-kt.github.io/coil/getting_started/#supported-image-formats
96+
Format.Heif -> type.isAnimated && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
9497
else -> false
9598
}
9699
} catch (e: Exception) {

0 commit comments

Comments
 (0)