I need a screen that has a completely transparent navigation bar but the status bar should have colorAccent.
I tried different solutions but none of them work.
1- Tried to change color with XML
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/zingat_blue_text</item>
<item name="colorPrimaryDark">@color/zingat_blue_text</item>
<item name="colorAccent">@color/zingat_blue_text</item>
<item name="android:colorBackground">@android:color/white</item>
</style>
<style name="NoActionBar" parent="AppTheme">
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowTranslucentNavigation">false</item>
</style>
When I tried code above, the navigation bar looks like picture below. That is not transparent
2- Tried to change windowTranslucentNavigation
I tried to set android:windowTranslucentNavigation = true and android:windowTranslucentStatus = false like below.
<style name="NoActionBar" parent="AppTheme">
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowTranslucentNavigation">true</item>// CHANGED THIS LINE
</style>
In this case, both status bar and navigation bar affecting and it shows like picture below. Navigation bar seem a little bit transparent but even I set windowTranslucentStatus=false it has transparent background the Toolbar show bottom of status bar.
3- Tried to java code
Window window = getWindow();
window.setFlags( WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
In this cas the navigation bar looks fully transparent but the status bar also looks transparent and the toolbar slide-up bottom of the status bar like solution 2.
I tried solutions below, none of them work
- How to Have a Transparent Status Bar but Leave Navigation Bar Opaque?
- How do I set my status bar transparent but keep by navigation bar black?
- Can I set FLAG_LAYOUT_NO_LIMITS only for status bar?
Thanks any advance.