mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 13:08:00 +01:00
nope, do not use Glide for loading non-animating gifs
This commit is contained in:
parent
129858119d
commit
1204eea382
1 changed files with 12 additions and 16 deletions
|
@ -148,23 +148,19 @@ fun Activity.loadImage(path: String, target: MySquareImageView, horizontalScroll
|
||||||
loadJpg(path, target, cropThumbnails)
|
loadJpg(path, target, cropThumbnails)
|
||||||
}
|
}
|
||||||
} else if (path.isGif()) {
|
} else if (path.isGif()) {
|
||||||
if (animateGifs) {
|
try {
|
||||||
try {
|
val gifDrawable = GifDrawable(path)
|
||||||
val gifDrawable = GifDrawable(path)
|
target.setImageDrawable(gifDrawable)
|
||||||
target.setImageDrawable(gifDrawable)
|
if (animateGifs) {
|
||||||
if (animateGifs) {
|
gifDrawable.start()
|
||||||
gifDrawable.start()
|
} else {
|
||||||
} else {
|
gifDrawable.stop()
|
||||||
gifDrawable.stop()
|
|
||||||
}
|
|
||||||
|
|
||||||
target.scaleType = if (cropThumbnails) ImageView.ScaleType.CENTER_CROP else ImageView.ScaleType.FIT_CENTER
|
|
||||||
} catch (e: Exception) {
|
|
||||||
loadJpg(path, target, cropThumbnails)
|
|
||||||
} catch (e: OutOfMemoryError) {
|
|
||||||
loadJpg(path, target, cropThumbnails)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
target.scaleType = if (cropThumbnails) ImageView.ScaleType.CENTER_CROP else ImageView.ScaleType.FIT_CENTER
|
||||||
|
} catch (e: Exception) {
|
||||||
|
loadJpg(path, target, cropThumbnails)
|
||||||
|
} catch (e: OutOfMemoryError) {
|
||||||
loadJpg(path, target, cropThumbnails)
|
loadJpg(path, target, cropThumbnails)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue