From eeaf854144e7501f594d22498730a33fc9785f1b Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 4 Apr 2017 21:48:59 +0200 Subject: [PATCH] fix some errors at loading fullscreen images --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 348da5858..935aeb93b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -156,12 +156,14 @@ class PhotoFragment : ViewPagerFragment() { private fun loadBitmap(degrees: Float = 0f) { if (degrees == 0f) { + val targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth + val targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight Glide.with(this) .load(medium.path) .asBitmap() .format(DecodeFormat.PREFER_ARGB_8888) .diskCacheStrategy(DiskCacheStrategy.NONE) - .override(ViewPagerActivity.screenWidth, ViewPagerActivity.screenHeight) + .override(targetWidth, targetHeight) .listener(object : RequestListener { override fun onException(e: java.lang.Exception?, model: String?, target: Target?, isFirstResource: Boolean): Boolean { return false