From 57e7fb03d1c8da169809ff0f2e4e4303e895e055 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 13 Jan 2019 20:02:11 +0100 Subject: [PATCH] reordering some PhotoFragment functions --- .../gallery/pro/fragments/PhotoFragment.kt | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) 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 f8a36a11b..4e35d0604 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 @@ -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