Skip to content

Instantly share code, notes, and snippets.

@grndvl1
Created February 20, 2018 19:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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