mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-29 16:08:00 +01:00
reset fullscreen image only on device rotation
This commit is contained in:
parent
718836459b
commit
c8b66cd439
2 changed files with 9 additions and 2 deletions
|
@ -90,7 +90,7 @@ dependencies {
|
||||||
implementation 'info.androidhive:imagefilters:1.0.7'
|
implementation 'info.androidhive:imagefilters:1.0.7'
|
||||||
implementation 'com.caverock:androidsvg-aar:1.4'
|
implementation 'com.caverock:androidsvg-aar:1.4'
|
||||||
implementation 'com.github.tibbi:gestureviews:a8e8fa8d27'
|
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 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
implementation 'com.github.penfeizhou.android.animation:awebp:2.17.0'
|
implementation 'com.github.penfeizhou.android.animation:awebp:2.17.0'
|
||||||
implementation 'com.github.penfeizhou.android.animation:apng:2.17.0'
|
implementation 'com.github.penfeizhou.android.animation:apng:2.17.0'
|
||||||
|
|
|
@ -83,6 +83,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
private var mWasInit = false
|
private var mWasInit = false
|
||||||
private var mIsPanorama = false
|
private var mIsPanorama = false
|
||||||
private var mIsSubsamplingVisible = false // checking view.visibility is unreliable, use an extra variable for it
|
private var mIsSubsamplingVisible = false // checking view.visibility is unreliable, use an extra variable for it
|
||||||
|
private var mShouldResetImage = false
|
||||||
private var mCurrentPortraitPhotoPath = ""
|
private var mCurrentPortraitPhotoPath = ""
|
||||||
private var mOriginalPath = ""
|
private var mOriginalPath = ""
|
||||||
private var mImageOrientation = -1
|
private var mImageOrientation = -1
|
||||||
|
@ -228,11 +229,12 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
loadImage()
|
loadImage()
|
||||||
} else if (mMedium.isGIF()) {
|
} else if (mMedium.isGIF()) {
|
||||||
loadGif()
|
loadGif()
|
||||||
} else if (mIsSubsamplingVisible) {
|
} else if (mIsSubsamplingVisible && mShouldResetImage) {
|
||||||
mView.subsampling_view.onGlobalLayout {
|
mView.subsampling_view.onGlobalLayout {
|
||||||
mView.subsampling_view.resetView()
|
mView.subsampling_view.resetView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mShouldResetImage = false
|
||||||
}
|
}
|
||||||
|
|
||||||
val allowPhotoGestures = config.allowPhotoGestures
|
val allowPhotoGestures = config.allowPhotoGestures
|
||||||
|
@ -294,6 +296,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
measureScreen()
|
measureScreen()
|
||||||
initExtendedDetails()
|
initExtendedDetails()
|
||||||
updateInstantSwitchWidths()
|
updateInstantSwitchWidths()
|
||||||
|
mShouldResetImage = true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setMenuVisibility(menuVisible: Boolean) {
|
override fun setMenuVisibility(menuVisible: Boolean) {
|
||||||
|
@ -708,6 +711,10 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
loadBitmap(false)
|
loadBitmap(false)
|
||||||
activity?.invalidateOptionsMenu()
|
activity?.invalidateOptionsMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onUpEvent() {
|
||||||
|
mShouldResetImage = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue