1

I would like to make the navigation bar completely transparent. What's the easiest way to do this, without having to copy paste code into each activity?

enter image description here

Joe
  • 263
  • 5
  • 20

1 Answers1

2

For translucent:

In styles

 <item name="android:windowTranslucentNavigation">true</item>

In activity

Window w = getWindow();  w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
       WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

For custom color:

In styles

<item name="android:navigationBarColor">@color/custom_color</item>

In activity

if (Build.VERSION.SDK_INT >= 21){getWindow().setNavigationBarColor(getResources().getColor(R.color.custom_color));}