From 58c871ed9aee4a07913ee3aab94a855fb1d24fc9 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Tue, 11 Jan 2022 15:12:09 +0100 Subject: [PATCH] Correctly hide system bars in `EmulationActivity` on Android >= 11 --- app/src/main/java/emu/skyline/EmulationActivity.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/emu/skyline/EmulationActivity.kt b/app/src/main/java/emu/skyline/EmulationActivity.kt index 4d3af6c9..e9589bc2 100644 --- a/app/src/main/java/emu/skyline/EmulationActivity.kt +++ b/app/src/main/java/emu/skyline/EmulationActivity.kt @@ -229,8 +229,10 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo setContentView(binding.root) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - window.insetsController?.hide(WindowInsets.Type.navigationBars() or WindowInsets.Type.systemBars() or WindowInsets.Type.systemGestures() or WindowInsets.Type.statusBars()) - window.insetsController?.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE + window.insetsController?.let { + it.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE + it.hide(WindowInsets.Type.systemBars()) + } } binding.gameView.holder.addCallback(this)