Skip to content

Instantly share code, notes, and snippets.

@juniorcesarabreu
Created May 17, 2019 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juniorcesarabreu/de06c466c1203b401c119ea19fa4ba42 to your computer and use it in GitHub Desktop.
Save juniorcesarabreu/de06c466c1203b401c119ea19fa4ba42 to your computer and use it in GitHub Desktop.
Change Navigation Bar Color in Android

It can be done inside styles.xml using

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

or

window.setNavigationBarColor(@ColorInt int color)

http://developer.android.com/reference/android/view/Window.html#setNavigationBarColor(int)

Note that the method was introduced in Android Lollipop and won't work on API version < 21.

The second method (works on KitKat) is to set windowTranslucentNavigation to true in the manifest and place a colored view beneath the navigation bar.

Font: https://stackoverflow.com/a/27839184/7482458

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment