From 1d04016c9bc7b6f27adfedb02fc5f31c96197ff7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 4 Aug 2017 23:10:22 +0200 Subject: [PATCH] create the system for toggling the slideshow --- .../gallery/activities/ViewPagerActivity.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 2331be6a4..6b6c47cf2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -47,6 +47,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mIsFullScreen = false private var mPos = -1 private var mShowAll = false + private var mIsSlideshowActive = false private var mRotationDegrees = 0f private var mLastHandledOrientation = 0 private var mPrevHashcode = 0 @@ -249,7 +250,19 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun initSlideshow() { SlideshowDialog(this) { + startSlideshow() + } + } + private fun startSlideshow() { + hideSystemUI() + mIsSlideshowActive = true + } + + private fun stopSlideshow() { + if (mIsSlideshowActive) { + showSystemUI() + mIsSlideshowActive = false } } @@ -538,6 +551,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (mIsFullScreen) { hideSystemUI() } else { + stopSlideshow() showSystemUI() } }