In one of my activities, I don't want the status bar to have any color. I want it to stay in whichever color the is before my app is ran.
I can change it to black, but black isn't the default, the default is kind of transparent. I don't want tot try to find which transparency is the correct one because It might be different on other people's phones so I want to basically not use the color feature of the status bar in this particular activiy
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
}
By default title bar is colored using colorPrimaryDark
(docs here, see pic below). Or when you look at Material theme:
<item name="statusBarColor">?attr/colorPrimaryDark</item>
You should also see this posts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With