Using the following code causes my layout to extend below the navigation bars. Id just like to change the status bar color without messing up the layout.
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= android.os.Build.VERSION_CODES.LOLLIPOP){
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow().setStatusBarColor(this.getResources().getColor(R.color.statusbar_color));
//TRANSPARENT FOR TESTING
getWindow().setNavigationBarColor(this.getResources().getColor(android.R.color.transparent));
}
I feel like I'm missing something...
Just add
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
It worked for me.
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