I would like to make the navigation bar completely transparent. What's the easiest way to do this, without having to copy paste code into each activity?
            Asked
            
        
        
            Active
            
        
            Viewed 1,103 times
        
    1
            
            
        - 
                    Transparent navigation bar? Don't create one. – tiborK Jan 08 '20 at 16:54
- 
                    Check out https://developer.android.com/guide/navigation/navigation-getting-started – tiborK Jan 08 '20 at 16:54
- 
                    @tiborK I have updated the post for a better understanding of what I'm talking about – Joe Jan 08 '20 at 16:58
- 
                    [Already answered here. Check this out](https://stackoverflow.com/questions/27839105/android-lollipop-change-navigation-bar-color) – Fahad Bin Asif Jan 08 '20 at 17:22
1 Answers
2
            For translucent:
In styles
 <item name="android:windowTranslucentNavigation">true</item>
In activity
Window w = getWindow();  w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
       WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
For custom color:
In styles
<item name="android:navigationBarColor">@color/custom_color</item>
In activity
if (Build.VERSION.SDK_INT >= 21){getWindow().setNavigationBarColor(getResources().getColor(R.color.custom_color));}
 
    
    
        Diego Galvez
        
- 51
- 2
- 
                    what would be the color code for transparent, because #00000000 doesn't seem to work.. – Joe Jan 08 '20 at 17:16
- 
                    

