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); } }