From 609e341b81e2ced9c48fe41d66113c7f322733e3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Feb 2017 18:57:17 +0100 Subject: [PATCH] feed the Glide bitmap to subsamplingScaleImageview --- .../simplemobiletools/gallery/fragments/PhotoFragment.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 f14d953f8..dd2d21c84 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -153,9 +153,9 @@ class PhotoFragment : ViewPagerFragment() { return false } - override fun onResourceReady(bitmap: Bitmap?, model: String?, target: Target?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean { + override fun onResourceReady(bitmap: Bitmap, model: String?, target: Target?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean { if (degrees == 0f) { - addZoomableView() + addZoomableView(bitmap) } else { photo_view.beVisible() subsampling_view.beGone() @@ -169,12 +169,12 @@ class PhotoFragment : ViewPagerFragment() { loadBitmap(degrees) } - private fun addZoomableView() { + private fun addZoomableView(bitmap: Bitmap) { if (!medium.isPng()) { subsamplingView.apply { beVisible() setDoubleTapZoomScale(1.2f) - setImage(ImageSource.uri(medium.path)) + setImage(ImageSource.cachedBitmap(bitmap)) orientation = SubsamplingScaleImageView.ORIENTATION_USE_EXIF maxScale = 5f setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {