From bb9b194d2cef9028890cc7e5b9956d7d1ed146f4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 19 Oct 2017 14:17:38 +0200 Subject: [PATCH] recheck extended details if some fields changed --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 4 +++- .../com/simplemobiletools/gallery/fragments/VideoFragment.kt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index d50d3e62f..1ca989a5b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -44,6 +44,7 @@ class PhotoFragment : ViewPagerFragment() { private var isFragmentVisible = false private var wasInit = false private var storedShowExtendedDetails = false + private var storedExtendedDetails = 0 lateinit var view: ViewGroup lateinit var medium: Medium @@ -111,11 +112,12 @@ class PhotoFragment : ViewPagerFragment() { override fun onPause() { super.onPause() storedShowExtendedDetails = context.config.showExtendedDetails + storedExtendedDetails = context.config.extendedDetails } override fun onResume() { super.onResume() - if (wasInit && context.config.showExtendedDetails != storedShowExtendedDetails) { + if (wasInit && (context.config.showExtendedDetails != storedShowExtendedDetails || context.config.extendedDetails != storedExtendedDetails)) { checkExtendedDetails() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 4cfba5eab..4efa3b8d1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -43,6 +43,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private var mIsFragmentVisible = false private var mPlayOnPrepare = false private var mStoredShowExtendedDetails = false + private var mStoredExtendedDetails = 0 private var mCurrTime = 0 private var mDuration = 0 @@ -88,7 +89,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee mView.video_volume_controller.beVisibleIf(context.config.allowVideoGestures) mView.video_brightness_controller.beVisibleIf(context.config.allowVideoGestures) - if (context.config.showExtendedDetails != mStoredShowExtendedDetails) { + if (context.config.showExtendedDetails != mStoredShowExtendedDetails || context.config.extendedDetails != mStoredExtendedDetails) { checkExtendedDetails() } } @@ -98,6 +99,7 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee pauseVideo() mIsFragmentVisible = false mStoredShowExtendedDetails = context.config.showExtendedDetails + mStoredExtendedDetails = context.config.extendedDetails } override fun onDestroy() {