I am trying to draw views behind the status bar like this:
I tried to produce this effect with the recommended techniques, but I get this:
It\'s cl
styles.xml(v21)
Then If you want to change statubarcolor, you have to remove TRANSLUENT_FLAG like this
Window window = activity().getWindow();
if(showTransluent){
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(Color.TRANSPARENT);
}else {
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(ContextCompat.getColor(activity(), R.color.colorPrimaryDark));
}
If I want StatusBar to be transluent and simultanieousy kepping view away from hidding behind StatusBar I use as most parent view FrameLayout with argument
My styles.xml(v21) look like
And styles.xml
Maybe the point key here is to be sure that you use AppCompactActivity as well as you use Theme.AppCompact as root for your styles.