Problem is that NavigationView
extends ScrimInsetsFrameLayout
which listens window insets changes and adds dim line to the layout.
The sameScrimInsetsFrameLayout
has styleable property insetForeground
at least in com.google.android.material:material:1.1.0-alpha07
so if you use:
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:statusBarColor">@color/transparent</item>
You only need to set that insetForeground
to @color/transparent
For example:
<com.google.android.material.navigation.NavigationView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:insetForeground="@color/transparent"/>
Warning:
This will not work if you set android:fitsSystemWindows="true"
.
Caution:
Using this approach means that you have to manage your insets manually since you are using translucent status and not fitting system windws.