Skip to content

Instantly share code, notes, and snippets.

@Cutta
Created December 20, 2016 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cutta/939a972b1c48523b85f9f4831b4e6ee5 to your computer and use it in GitHub Desktop.
Save Cutta/939a972b1c48523b85f9f4831b4e6ee5 to your computer and use it in GitHub Desktop.
Set visibility of Navigation bar
private void showHideChrome(boolean show) {
int flags = show ? 0 : View.SYSTEM_UI_FLAG_LOW_PROFILE;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
if (!show) {
flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE;
}
mContainerView.setSystemUiVisibility(flags);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment