Set glide to use the gif loop count (#2263)
This commit is contained in:
parent
b60b26bbd0
commit
0f16351f5f
@ -19,6 +19,7 @@ import com.bumptech.glide.load.DataSource
|
|||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
import com.bumptech.glide.load.engine.GlideException
|
import com.bumptech.glide.load.engine.GlideException
|
||||||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
|
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.RequestListener
|
||||||
import com.bumptech.glide.request.target.Target
|
import com.bumptech.glide.request.target.Target
|
||||||
import com.bumptech.glide.request.transition.NoTransition
|
import com.bumptech.glide.request.transition.NoTransition
|
||||||
@ -457,6 +458,9 @@ class PagerPageHolder(
|
|||||||
dataSource: DataSource?,
|
dataSource: DataSource?,
|
||||||
isFirstResource: Boolean
|
isFirstResource: Boolean
|
||||||
): Boolean {
|
): Boolean {
|
||||||
|
if (resource is GifDrawable) {
|
||||||
|
resource.setLoopCount(GifDrawable.LOOP_INTRINSIC)
|
||||||
|
}
|
||||||
onImageDecoded()
|
onImageDecoded()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import com.bumptech.glide.load.DataSource
|
|||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
import com.bumptech.glide.load.engine.GlideException
|
import com.bumptech.glide.load.engine.GlideException
|
||||||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
|
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.RequestListener
|
||||||
import com.bumptech.glide.request.target.Target
|
import com.bumptech.glide.request.target.Target
|
||||||
import com.bumptech.glide.request.transition.NoTransition
|
import com.bumptech.glide.request.transition.NoTransition
|
||||||
@ -497,6 +498,9 @@ class WebtoonPageHolder(
|
|||||||
dataSource: DataSource?,
|
dataSource: DataSource?,
|
||||||
isFirstResource: Boolean
|
isFirstResource: Boolean
|
||||||
): Boolean {
|
): Boolean {
|
||||||
|
if (resource is GifDrawable) {
|
||||||
|
resource.setLoopCount(GifDrawable.LOOP_INTRINSIC)
|
||||||
|
}
|
||||||
onImageDecoded()
|
onImageDecoded()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user