title: Coloring Android Status Bar in Nav Drawer
body: <p>In this app I'm building, I've added a Navigation Drawer fragment into my activity. I'm using 5.0, so I've been able to set the primaryColor and primaryColorDark to get the right colors. I've decided to try and style my Nav Drawer to be very similar to Google Now's drawer in 5.0, where the Nav Drawer has it's own background for the status bar. (Can't post pictures, not enough reputation >.>)</p>
  
  <p>I've followed this question's recommendations <a href="https://stackoverflow.com/questions/26440879/how-do-i-use-drawerlayout-to-display-over-the-actionbar-toolbar-and-under-the-st">here</a>, which has helped quite a bit. I've achieved drawing my Nav Drawer under the status bar when I pull it out. Only trouble is, I can't figure out how to set the color of the status bar that shows in my drawer. Currently, it just shows white. </p>
  
  <p>Here are the relevant bits of my styles and code:</p>
  
  <p>Activity Layout:</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".Main"
      android:fitsSystemWindows="true"&gt;
  
      &lt;!-- main content --&gt;
      ...
  
      &lt;!-- Drawer fragment --&gt;
      &lt;fragment
          android:id="@+id/navigation_drawer"
          android:layout_width="@dimen/navigation_drawer_width"
          android:layout_height="match_parent"
          android:layout_gravity="left|start"
          android:theme="@style/DrawerTheme"
          android:fitsSystemWindows="true"
          android:choiceMode="singleChoice"
          android:name="com.myname.appname.NavigationDrawerFragment"
          tools:layout="@layout/fragment_navigation_drawer" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Fragment Layout: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/navDrawerFragment"
      android:theme="@style/DrawerTheme"
      android:background="@color/WindowBackground"
      tools:context=".NavigationDrawerFragment"
      android:fitsSystemWindows="true"&gt;
  
       &lt;!-- content here --&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Per link above, setting color of my status bar for the activity (this part works correctly):</p>
  
  <pre><code>public void onCreate(Bundled savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      // ....
  
      drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
      drawerLayout.setDrawerShadow(R.drawable.drawer_shadow, Gravity.START);
      drawerLayout.setStatusBarBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
  
      // ....
  }
  </code></pre>
  
  <p>And finally, my associated styles for the activity, and what I've 'tried' to assign to the fragment.</p>
  
  <pre><code>&lt;style name="StatusBarActivityTheme" parent="MyAppTheme"&gt;
      &lt;item name="android:windowDrawsSystemBarBackgrounds"&gt;true&lt;/item&gt;
      &lt;item name="android:statusBarColor"&gt;@android:color/transparent&lt;/item&gt;
  &lt;/style&gt;
  
  
  &lt;style name="DrawerTheme" parent="MyAppTheme"&gt;
      &lt;item name="android:statusBarColor"&gt;#000000&lt;/item&gt;
      &lt;item name="android:colorPrimaryDark"&gt;#000000&lt;/item&gt;
      &lt;item name="android:windowDrawsSystemBarBackgrounds"&gt;true&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>Thanks in advance for any help you can send my way! I suspect my issue is related to do with how Google Now's primary screen has a transparent status bar, and only colors it during the Nav Drawer, but any news to the contrary would be great!</p>