This can be done for API level 21+. Put this style in your v21 / themes.xml and use it as your application theme
<style name="MyApplicationTheme" parent="Theme.AppCompat.NoActionBar"> <item name="android:navigationBarColor">#4D000000</item> </style>
Keep in mind that your activity must also be in full screen mode to go under the navigation bar (soft keys)
For an action extending AppCompatActivity, you can do this in code:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); }
Nima k
source share