From 862b02995322ab0394118605790f76afd5522967 Mon Sep 17 00:00:00 2001 From: Hans de Zwart Date: Tue, 11 Aug 2026 22:07:24 +0200 Subject: [PATCH] Keep the navigation bar; hide only the status bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hideSystemBars() asked for systemBars(), which is the union of the two, so the way out of the app was an invisible swipe you had to remember. statusBars() leaves the navigation bar where it is: still fullscreen at the top, but leaving is now an affordance you can see. On three-button navigation it also owns the bottom strip outright, so those taps never reach the panel at all — the lift-not-press rule still carries the gesture case, where the pill is only drawn over the app. The pre-Android-11 branch loses HIDE_NAVIGATION, LAYOUT_HIDE_NAVIGATION and IMMERSIVE_STICKY along with it; immersive only governs a navigation bar that is hidden, and this one isn't. The layout needed nothing: .panel--bottom .inner already pads by max(14px, env(safe-area-inset-bottom)), so the readout lifts clear of the bar by itself. Confirmed on device. Not tagged. This rides along with whatever else goes into 1.1. Co-Authored-By: Claude Opus 5 --- .../nl/hansdezwart/bgclock/MainActivity.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/nl/hansdezwart/bgclock/MainActivity.java b/android/app/src/main/java/nl/hansdezwart/bgclock/MainActivity.java index 2b66289..0305e84 100644 --- a/android/app/src/main/java/nl/hansdezwart/bgclock/MainActivity.java +++ b/android/app/src/main/java/nl/hansdezwart/bgclock/MainActivity.java @@ -95,23 +95,29 @@ public class MainActivity extends Activity { if (hasFocus) hideSystemBars(); } - /** The page calls requestFullscreen(), which a WebView ignores. This is that. */ + /** + * The page calls requestFullscreen(), which a WebView ignores. This is that. + * + * Only the status bar goes. The navigation bar stays: it is how you leave the + * app, and leaving it visible makes that obvious rather than a remembered + * swipe. statusBars() rather than systemBars() — the latter is the union of + * the two. + */ private void hideSystemBars() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { WindowInsetsController c = getWindow().getInsetsController(); if (c != null) { - c.hide(WindowInsets.Type.systemBars()); + c.hide(WindowInsets.Type.statusBars()); c.setSystemBarsBehavior( WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE); } } else { + // no IMMERSIVE_STICKY or HIDE_NAVIGATION here: immersive only governs + // a hidden navigation bar, and this one stays getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + | View.SYSTEM_UI_FLAG_FULLSCREEN); } }