Skip to content

Instantly share code, notes, and snippets.

@tobrun
Created November 30, 2013 13:44
Show Gist options
  • Save tobrun/7719277 to your computer and use it in GitHub Desktop.
Save tobrun/7719277 to your computer and use it in GitHub Desktop.
Immersive sticky mode android
@SuppressLint("NewApi")
@Override
public void onWindowFocusChanged(final boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
mDecorView.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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment