Question : android hide system bar programmatically
Answered by : yawning-yacare-lszo7vxj8lkj
private void hideSystemBars() { WindowInsetsControllerCompat windowInsetsController = ViewCompat.getWindowInsetsController(window.getDecorView()); if (windowInsetsController == null) { return; } // Configure the behavior of the hidden system bars windowInsetsController.setSystemBarsBehavior( WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE ); // Hide both the status bar and the navigation bar windowInsetsController.hide(WindowInsetsCompat.Type.systemBars()); }
Source : | Last Update : Sat, 22 Jan 22