diff --git a/app/build.gradle b/app/build.gradle index 58a9d0587..47ec3526e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -90,7 +90,7 @@ dependencies { implementation 'info.androidhive:imagefilters:1.0.7' implementation 'com.caverock:androidsvg-aar:1.4' implementation 'com.github.tibbi:gestureviews:a8e8fa8d27' - implementation 'com.github.tibbi:subsampling-scale-image-view:05b02e26b7' + implementation 'com.github.tibbi:subsampling-scale-image-view:b51482b3fa' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'com.github.penfeizhou.android.animation:awebp:2.17.0' implementation 'com.github.penfeizhou.android.animation:apng:2.17.0' 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 06002622f..044127867 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 @@ -83,6 +83,7 @@ class PhotoFragment : ViewPagerFragment() { private var mWasInit = false private var mIsPanorama = false private var mIsSubsamplingVisible = false // checking view.visibility is unreliable, use an extra variable for it + private var mShouldResetImage = false private var mCurrentPortraitPhotoPath = "" private var mOriginalPath = "" private var mImageOrientation = -1 @@ -228,11 +229,12 @@ class PhotoFragment : ViewPagerFragment() { loadImage() } else if (mMedium.isGIF()) { loadGif() - } else if (mIsSubsamplingVisible) { + } else if (mIsSubsamplingVisible && mShouldResetImage) { mView.subsampling_view.onGlobalLayout { mView.subsampling_view.resetView() } } + mShouldResetImage = false } val allowPhotoGestures = config.allowPhotoGestures @@ -294,6 +296,7 @@ class PhotoFragment : ViewPagerFragment() { measureScreen() initExtendedDetails() updateInstantSwitchWidths() + mShouldResetImage = true } override fun setMenuVisibility(menuVisible: Boolean) { @@ -708,6 +711,10 @@ class PhotoFragment : ViewPagerFragment() { loadBitmap(false) activity?.invalidateOptionsMenu() } + + override fun onUpEvent() { + mShouldResetImage = false + } } } }