title: Set color on GradientDrawable not working from Fragment
body: <p>I have a background drawable like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
  &lt;item android:bottom="80dp"
        android:id="@+id/card_background"&gt;
      &lt;shape&gt;
          &lt;solid android:color="@color/x_card_color_pink"
                 android:height="100dp"/&gt;
          &lt;corners
              android:topLeftRadius="10dp"
              android:topRightRadius="10dp"/&gt;
      &lt;/shape&gt;
  &lt;/item&gt;
  
  &lt;item android:top="120dp"&gt;
      &lt;shape&gt;
          &lt;solid android:color="@color/white"
              android:height="100dp"/&gt;
          &lt;corners
              android:bottomLeftRadius="10dp"
              android:bottomRightRadius="10dp"/&gt;
      &lt;/shape&gt;
  &lt;/item&gt;
  
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>I want to change the color of <code>card_background</code>. When I set the new color from the activities <code>onCreate</code> it works:</p>
  
  <pre><code>    LayerDrawable layerDrawable = (LayerDrawable) ContextCompat.getDrawable(this, R.drawable.card_background);
      GradientDrawable gradientDrawable = (GradientDrawable) layerDrawable.findDrawableByLayerId(R.id.card_background);
      gradientDrawable.setColor(0xFFEBC51B); //Successfully set to yellow from activity
  </code></pre>
  
  <p>However If try setting it from the fragment that also is showing the background I cant make it change. I want to be able to do this in a clickhandler later on but right now I use the same code in the fragments <code>onCreate</code>:</p>
  
  <pre><code>    LayerDrawable layerDrawable = (LayerDrawable) ContextCompat.getDrawable(getActivity(), R.drawable.card_background);
      GradientDrawable gradientDrawable = (GradientDrawable) layerDrawable.findDrawableByLayerId(R.id.card_background);
      gradientDrawable.setColor(0xFF5ABC63); //Fail to set to green from fragment
  </code></pre>
  
  <p>Im thinking since I am showing the fragment at the same time as I update it I have to refresh it or something? I tried the method <code>invalidateSelf</code> but with no effect.</p>
  
  <p>Any ideas on how I can change the background color from the Fragment?</p>