Keep the navigation bar; hide only the status bar

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 <noreply@anthropic.com>
This commit is contained in:
2026-08-11 22:07:24 +02:00
co-authored by Claude Opus 5
parent a672268a8f
commit 862b029953
@@ -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);
}
}