reordering some PhotoFragment functions

This commit is contained in:
tibbi 2019-01-13 20:02:11 +01:00
parent bb038aa47b
commit 57e7fb03d1
1 changed files with 27 additions and 27 deletions

View File

@ -204,6 +204,33 @@ class PhotoFragment : ViewPagerFragment() {
storeStateVariables()
}
override fun onDestroyView() {
super.onDestroyView()
if (activity?.isDestroyed == false) {
mView.subsampling_view.recycle()
}
mIoadZoomableViewHandler.removeCallbacksAndMessages(null)
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
// avoid GIFs being skewed, played in wrong aspect ratio
if (mMedium.isGIF()) {
mView.onGlobalLayout {
Handler().postDelayed({
loadGif()
}, 50)
}
} else {
hideZoomableView()
loadImage()
}
initExtendedDetails()
updateInstantSwitchWidths()
}
override fun setMenuVisibility(menuVisible: Boolean) {
super.setMenuVisibility(menuVisible)
mIsFragmentVisible = menuVisible
@ -537,33 +564,6 @@ class PhotoFragment : ViewPagerFragment() {
}
}
override fun onDestroyView() {
super.onDestroyView()
if (activity?.isDestroyed == false) {
mView.subsampling_view.recycle()
}
mIoadZoomableViewHandler.removeCallbacksAndMessages(null)
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
// avoid GIFs being skewed, played in wrong aspect ratio
if (mMedium.isGIF()) {
mView.onGlobalLayout {
Handler().postDelayed({
loadGif()
}, 50)
}
} else {
hideZoomableView()
loadImage()
}
initExtendedDetails()
updateInstantSwitchWidths()
}
private fun hideZoomableView() {
if (context?.config?.allowZoomingImages == true) {
mIsSubsamplingVisible = false