Android Programming: How to make navigation bar fully transparent in Android Nougat

1k views Asked by At

I want to make the navigation bar fully transparent in my app. I have tried the other answers, but they only make the status bar fully transparent and the navigation bar still has a dark half-transparent color. Here is my code:

styles.xml:

<style name="AppTheme" parent="android:Theme.Material.Light.NoActionBar">
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
    <item name="android:navigationBarColor">@android:color/transparent</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
</style>

Activity.java:

getWindow().setFlags(
    WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
    WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

Here is the result I'm trying to get: goal

and here is the result I'm currently getting: result

Is there any way to achieve a fully transparent navigation bar?

1

There are 1 answers

0
Aditya On

Try to set <item name="android:android:windowTranslucentStatus">true</item> set android:statusBarColor to @android:color/transparent.

Then add code below:

getWindow().getDecorView().setSystemUiVisibility(
        View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);

If you also want the navigation bar to be translucent, set android:navigationBarColor to @android:color/transparent and combine the flag View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION as well.

Try it may it will work.