Is there a way to set the navigationbar color in a fullscreen activity?
if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setNavigationBarColor(getResources().getColor(R.color.Theme_color));
And this line in my theme-style:
<item name="android:navigationBarColor" tools:targetApi="21">#E64A19</item>
Both resulting in the same transparant navbar above my activities layout...
Code:
Acitivity :
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Remove notification bar
this.getWindow()
.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_account);
if (getResources().getBoolean(R.bool.portrait_only)) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow()
.setNavigationBarColor(getResources().getColor(R.color.Theme_color));
}
//other code ... (irrelevant)
Theme:
<style name="FullscreenTheme" parent="android:Theme.NoTitleBar">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@null</item>
<item name="metaButtonBarStyle">@style/ButtonBar</item>
<item name="metaButtonBarButtonStyle">@style/ButtonBarButton</item>
<item name="android:navigationBarColor" tools:targetApi="21">#E64A19</item>
</style>
The result is a black navigationbar. But I want a orange (#E64A19) navigation-bar.
Result: