I need to change the navigation bar on android. Just like the \'light\' variant on the right in the image below as given in https://www.google.co.in/design/spec/layout/stru
Starting from Android O it gets really straightforward, as you could just:
View.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
For this to take effect, the window must request FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS but not FLAG_TRANSLUCENT_NAVIGATION.
Documentation: https://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
If your targeted user Api level is 27 or Higher just use this line in your AppTheme
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">@color/your_color</item>
</style>
But if your targeted user api level is less 27 and higher you can you these line
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">@color/your_color</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
</style>
By doing so, The user having API level 27 or higher get changed-color of BottomNav icon, but the user having API level less than 27, can't enjoy these feature
From what I can tell, those Icons are part of com.android.systemui, which is why you need root + patch or injection (like Xposed) to be able to change them.
Consider it from a different perspective. One possibility might be setting the theme for that activity to light or dark, then programmatically setting the background color of the bar. One of those themes should have the dark icons.
Another alternative could be to hide the bar altogether https://developer.android.com/training/system-ui/navigation.html
and then create a second Toolbar on the bottom with your own buttons.
If you are using API 27 (Android 8.1) or greater, you can achieve it with this in your theme:
<item name="android:windowLightNavigationBar">true</item>
You can create a folder called values-v27 and place a version of your theme (in styles.xml) with a light navigation bar and the above code to get dark navigation bar buttons.
This way, users with Android 8.0 or lower will get the standard (black) navigation bar while users with Android 8.1 or greater will get a white navbar with dark buttons.