reordering some PhotoFragment functions
This commit is contained in:
parent
bb038aa47b
commit
57e7fb03d1
1 changed files with 27 additions and 27 deletions
|
@ -204,6 +204,33 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
storeStateVariables()
|
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) {
|
override fun setMenuVisibility(menuVisible: Boolean) {
|
||||||
super.setMenuVisibility(menuVisible)
|
super.setMenuVisibility(menuVisible)
|
||||||
mIsFragmentVisible = 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() {
|
private fun hideZoomableView() {
|
||||||
if (context?.config?.allowZoomingImages == true) {
|
if (context?.config?.allowZoomingImages == true) {
|
||||||
mIsSubsamplingVisible = false
|
mIsSubsamplingVisible = false
|
||||||
|
|
Loading…
Reference in a new issue