change soft keys background from black to transparent in android app

I want to change the soft keys(Not sure about name of these buttons all together) background from black to transparent in my app so that users will get a complete visibility of items in listview in my app. I found this feature in Google photos android app. Please that app screenshot here.

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

Please some one could help me find a reference document or code to achieve this functionality. Thanks in advance.


This is possible to do 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 should also be full screen to go below the navigation bar (soft keys)

For an activity that extends AppCompatActivity, you can do it in code by:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}

Soft keys all together are called Navigation Bar.

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

<item name="android:windowTranslucentNavigation">true</item>
链接地址: http://www.djcxy.com/p/87644.html

上一篇: 为什么布尔值不抛出StackOverflowException?

下一篇: 在Android应用程序中将软键背景从黑色更改为透明