From 0f16351f5f2b97385223fb929c5d5a0ae4c8a027 Mon Sep 17 00:00:00 2001 From: Ken Swenson Date: Mon, 14 Oct 2019 05:11:11 -0400 Subject: [PATCH] Set glide to use the gif loop count (#2263) --- .../tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt | 4 ++++ .../tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt index fc8dece8f0..8ec0ead814 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt @@ -19,6 +19,7 @@ import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions +import com.bumptech.glide.load.resource.gif.GifDrawable import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.target.Target import com.bumptech.glide.request.transition.NoTransition @@ -457,6 +458,9 @@ class PagerPageHolder( dataSource: DataSource?, isFirstResource: Boolean ): Boolean { + if (resource is GifDrawable) { + resource.setLoopCount(GifDrawable.LOOP_INTRINSIC) + } onImageDecoded() return false } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt index 40ab711a4d..754dbb7e1d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt @@ -18,6 +18,7 @@ import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions +import com.bumptech.glide.load.resource.gif.GifDrawable import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.target.Target import com.bumptech.glide.request.transition.NoTransition @@ -497,6 +498,9 @@ class WebtoonPageHolder( dataSource: DataSource?, isFirstResource: Boolean ): Boolean { + if (resource is GifDrawable) { + resource.setLoopCount(GifDrawable.LOOP_INTRINSIC) + } onImageDecoded() return false }