title: Android change toolbar color and status bar color but keep statusbar shadow
body: <p>I'd like to keep the shadow on the status bar
  but I need to programmatically change the toolbar and status bar color.
  I can do this, but if I programmatically set the status bar color, it loses the shadow (I believe it's the elevation)</p>
  <p>I have <code>android:fitsSystemWindows=&quot;true&quot;</code> on my root (coordlayout)
  I have this as my theme:</p>
  <pre><code>&lt;style name=&quot;AppTheme.NoActionBar&quot;&gt;
      &lt;item name=&quot;windowActionBar&quot;&gt;false&lt;/item&gt;
      &lt;item name=&quot;windowNoTitle&quot;&gt;true&lt;/item&gt;
      &lt;item name=&quot;android:windowDrawsSystemBarBackgrounds&quot;&gt;true&lt;/item&gt;
      &lt;item name=&quot;android:statusBarColor&quot;&gt;@android:color/transparent&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  <p>Im setting the toolbar color:</p>
  <pre><code>mToolbar.setBackgroundColor((Color.parseColor(&quot;#FF4040&quot;)));
  </code></pre>
  <p>How do I set both without losing the shadow?</p>
  <p><a href="https://i.stack.imgur.com/MYakq.png" rel="nofollow noreferrer">default status bar color with shadow</a></p>
  <p><a href="https://i.stack.imgur.com/ZTUGi.png" rel="nofollow noreferrer">setting the second color on toolbar</a></p>