Skip to content

Instantly share code, notes, and snippets.

@grndvl1
Created February 20, 2018 19:15
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 grndvl1/b24920f3ca2c9e2c1dd92f1c43e5fe5a to your computer and use it in GitHub Desktop.
Save grndvl1/b24920f3ca2c9e2c1dd92f1c43e5fe5a to your computer and use it in GitHub Desktop.
Android Notification Bar White with Black Icons - Programatically
Window window = this.getWindow();
// clear FLAG_TRANSLUCENT_STATUS flag:
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
// finally change the color
window.setStatusBarColor(ContextCompat.getColor(this, R.color.window_background));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment