Created
February 20, 2018 19:15
-
-
Save grndvl1/b24920f3ca2c9e2c1dd92f1c43e5fe5a to your computer and use it in GitHub Desktop.
Android Notification Bar White with Black Icons - Programatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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