Change the background of soft keys from black to transparent in the Android application

I want to change the soft keys (not sure about the name of these buttons together), from black to transparent in my application, so that users get full visibility of the items in the list in my application. I found this feature in the Google Android app for Android. Please take this screenshot.

https://lh3.googleusercontent.com/_J3bZG-H80ojW-bIz5wPfneLV8s83XViANUZ9Fdh2-qWIsrgX83FbttNb44_cHxj1w=h900-rw

Please someone can help me find a help document or code to achieve this functionality. Thanks in advance.

+7
android listview
source share
2 answers

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); } 
+2
source share

Soft keys are collectively referred to as the navigation bar.

To make it transparent, add this line to your activity style (for API 19 and above):

 <item name="android:windowTranslucentNavigation">true</item> 
+2
source share

All Articles