title: Android drawer navigation dark mode with transparent status bar
body: <p>I use navigation drawer in my app and I try to implement dark theme. When the app doesn't cover the whole screen and the status bar isn't transparent the <em>navigationView</em> is automatically colored to dark. But when the app covers the whole screen and the status bar is transparent the <em>navigationView</em> stays white. How can I force the <em>navigationView</em> to be dark even when the app covers the whole screen and status bar is transparent?</p>
  
  <p>I don't explicitily set the background color or the text color, it uses the default values.</p>
  
  <p><a href="https://i.stack.imgur.com/RctW5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RctW5.jpg" alt="This is how it behaves"></a> </p>
  
  <p>The layout code looks like this:</p>
  
  <pre><code>&lt;androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          xmlns:tools="http://schemas.android.com/tools"
          android:orientation="vertical"
          android:id="@+id/drawer_layout"&gt;
  
  &lt;!-- Some other views wrapped in RelativeLayout --&gt;
  
      &lt;com.google.android.material.navigation.NavigationView
          android:id="@+id/mainnav"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          app:menu="@menu/mainmenu"
          android:layout_gravity="start"
          app:headerLayout="@layout/mainmenu_header"
          android:fitsSystemWindows="false"
          app:insetForeground="@null"&gt;
  
          &lt;include android:id="@+id/mainmenuheader"
              layout="@layout/mainmenu_header"/&gt;
  
      &lt;/com.google.android.material.navigation.NavigationView&gt;
  &lt;/androidx.drawerlayout.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>The style that the activity uses to make it fullscreen with transparent status bar looks like this:</p>
  
  <pre><code>&lt;style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light.NoActionBar"&gt;
      &lt;item name="android:windowTranslucentStatus"&gt;true&lt;/item&gt;
      &lt;item name="android:windowTranslucentNavigation"&gt;true&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And finally in the manifest for the activity a apply the theme and set the <em>fitsSystemWindows</em> to true:</p>
  
  <pre><code>&lt;activity
      android:name=".map.MapActivity"
      android:screenOrientation="portrait"
      android:configChanges="uiMode"
      android:fitsSystemWindows="true"         
  android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" /&gt;
  </code></pre>