From b274f9ad57e9b547e318073db1b2ba92d5765a7d Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 14 May 2021 10:09:11 +0200 Subject: [PATCH] fix a glitch at toggling fullscreen mode in split screen --- .../gallery/pro/activities/ViewPagerActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index d069e8b98..dce1b4e33 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -27,6 +27,7 @@ import android.view.View import android.view.WindowManager import android.view.animation.DecelerateInterpolator import android.widget.Toast +import androidx.annotation.RequiresApi import androidx.exifinterface.media.ExifInterface import androidx.print.PrintHelper import androidx.viewpager.widget.ViewPager @@ -323,6 +324,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } + @RequiresApi(Build.VERSION_CODES.N) private fun initContinue() { if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) { if (isShowHiddenFlagNeeded()) { @@ -368,7 +370,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> - mIsFullScreen = if (visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE == 0) { + mIsFullScreen = if (isNougatPlus() && isInMultiWindowMode) { + visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE != 0 + } else if (visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE == 0) { false } else { visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0