Skip to content

Instantly share code, notes, and snippets.

@guavabot
Created September 30, 2016 11:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guavabot/85f5ee9d92529d3aa83eae5bad13f930 to your computer and use it in GitHub Desktop.
Save guavabot/85f5ee9d92529d3aa83eae5bad13f930 to your computer and use it in GitHub Desktop.
Draw behind status bar
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

    getWindow().setStatusBarColor(ContextCompat.getColor(this, android.R.color.transparent));
}

Use with FitsSystemWindows in the first view that should have an inset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment