From 74f88583d27df38a7d50f3112f9e03b7736c70cf Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 14:23:48 +0200 Subject: [PATCH] fix #857, improve fullscreen toggling at Immersive mode --- .../gallery/activities/ViewPagerActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 6a88aec32..e9e6290e5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -245,7 +245,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> - mIsFullScreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 + mIsFullScreen = if (visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE == 0) { + false + } else { + visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 + } + view_pager.adapter?.let { (it as MyPagerAdapter).toggleFullscreen(mIsFullScreen) checkSystemUI()