One of the features introduced in KitKat is Immersive mode . Immersive mode gives the user the ability to display / hide the status bar and navigation bar by scrolling.
Code example:
public void toggleHideyBar() { int uiOptions = getActivity().getWindow().getDecorView().getSystemUiVisibility(); int newUiOptions = uiOptions; boolean isImmersiveModeEnabled = ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions); if (isImmersiveModeEnabled) { Log.i(TAG, "Turning immersive mode mode off. "); } else { Log.i(TAG, "Turning immersive mode mode on."); }
source share