From a93d4be1125874bdf0460057ec3f261300d947c4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Apr 2017 20:08:34 +0200 Subject: [PATCH] fix a typo at photo fragment visibility check --- .../gallery/fragments/PhotoFragment.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 935aeb93b..71634fd7b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -113,9 +113,11 @@ class PhotoFragment : ViewPagerFragment() { if (menuVisible) { addZoomableView() } else { - view.subsampling_view.recycle() - view.subsampling_view.beGone() - view.subsampling_view.background = ColorDrawable(Color.TRANSPARENT) + view.subsampling_view.apply { + recycle() + beGone() + background = ColorDrawable(Color.TRANSPARENT) + } } } } @@ -170,7 +172,7 @@ class PhotoFragment : ViewPagerFragment() { } override fun onResourceReady(resource: Bitmap?, model: String?, target: Target?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean { - if (isMenuVisible) + if (isFragmentVisible) addZoomableView() return false } @@ -188,7 +190,7 @@ class PhotoFragment : ViewPagerFragment() { } private fun addZoomableView() { - if ((medium.isImage()) && isMenuVisible && view.subsampling_view.visibility == View.GONE) { + if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.visibility == View.GONE) { view.subsampling_view.apply { maxScale = 10f beVisible()