From 388a6dd2c14e215946c9c18fdc2cde770bca5e1f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 4 Dec 2016 23:11:41 +0100 Subject: [PATCH] fix fullscreen toggle on some devices --- .../gallery/activities/ViewPagerActivity.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 0b7a2728f..af089265c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -76,6 +76,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View mPos = 0 mIsFullScreen = false mMedia = ArrayList() + showSystemUI() mDirectory = File(mPath).parent title = mPath.getFilenameFromPath() @@ -308,11 +309,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } override fun onSystemUiVisibilityChange(visibility: Int) { - if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) { - mIsFullScreen = false - } + view_pager.adapter?.apply { + if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) { + mIsFullScreen = false + showSystemUI() + } - val adapter = view_pager.adapter as MyPagerAdapter - adapter.updateUiVisibility(mIsFullScreen, mPos) + (this as MyPagerAdapter).updateUiVisibility(mIsFullScreen, mPos) + } } }