From 84110a0638974b49d2e23cb8f9eb0df7f149626c Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 21 Aug 2019 14:28:27 +0200 Subject: [PATCH] load the fullscreen image in full resolution with Glide --- .../simplemobiletools/gallery/pro/fragments/PhotoFragment.kt | 2 +- .../gallery/pro/helpers/MyGlideImageDecoder.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index db7c6058d..9c39b95d0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -464,7 +464,7 @@ class PhotoFragment : ViewPagerFragment() { val minTileDpi = if (showHighestQuality) -1 else getMinTileDpi() val bitmapDecoder = object : DecoderFactory { - override fun make() = MyGlideImageDecoder(rotation, mScreenWidth, mScreenHeight) + override fun make() = MyGlideImageDecoder(rotation) } val regionDecoder = object : DecoderFactory { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt index dde41e841..b1a3461eb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyGlideImageDecoder.kt @@ -7,9 +7,10 @@ import com.bumptech.glide.Glide import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.request.RequestOptions +import com.bumptech.glide.request.target.Target import com.davemorrissey.labs.subscaleview.ImageDecoder -class MyGlideImageDecoder(val degrees: Int, val width: Int, val height: Int) : ImageDecoder { +class MyGlideImageDecoder(val degrees: Int) : ImageDecoder { override fun decode(context: Context, uri: Uri): Bitmap { val options = RequestOptions() @@ -22,7 +23,7 @@ class MyGlideImageDecoder(val degrees: Int, val width: Int, val height: Int) : I .load(uri) .apply(options) .transform(RotateTransformation(-degrees)) - .into(width, height) + .into(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) return builder.get() }