title: Gradient color using MaterialButton and shapeAppearance
body: <p>I want to make a <code>Button</code> like this one :
  <a href="https://i.stack.imgur.com/MvnQE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MvnQE.png" alt="enter image description here" /></a></p>
  <p>I try it using <code>style</code> with <code>shapeAppearance</code> :
  </p>
  <pre><code>&lt;style name=&quot;ShapeAppearance.Button&quot; parent=&quot;ShapeAppearance.MaterialComponents&quot;&gt;
      &lt;item name=&quot;cornerFamily&quot;&gt;rounded&lt;/item&gt;
      &lt;item name=&quot;cornerSizeTopLeft&quot;&gt;@dimen/button_corner_radius&lt;/item&gt;
      &lt;item name=&quot;cornerSizeTopRight&quot;&gt;5dp&lt;/item&gt;
      &lt;item name=&quot;cornerSizeBottomRight&quot;&gt;@dimen/button_corner_radius&lt;/item&gt;
      &lt;item name=&quot;cornerSizeBottomLeft&quot;&gt;5dp&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;dimen name=&quot;button_corner_radius&quot;&gt;40dp&lt;/dimen&gt;
  </code></pre>
  
  <p>I apply the style in my MaterialButton like this :</p>
  <pre><code>app:shapeAppearance=&quot;@style/ShapeAppearance.Button&quot; 
  </code></pre>
  <p>The result is :</p>
  <p><a href="https://i.stack.imgur.com/0i7Bb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0i7Bb.png" alt="enter image description here" /></a></p>
  <p>Now, I try to put a linear gradient :</p>
  <ul>
  <li>#DF2D48 @ 0.0</li>
  <li>#D72D46 @ 0.2</li>
  <li>#AF223B @ 0.5</li>
  <li>#AC2139 @ 1.0</li>
  </ul>
  <p>For example :</p>
  <pre><code>&lt;shape xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:shape=&quot;rectangle&quot;&gt;
      &lt;gradient
          android:startColor=&quot;#DF2D48&quot;
          android:centerColor=&quot;#D72D46&quot;
          android:endColor=&quot;#AC2139&quot;
          android:angle=&quot;360&quot; /&gt;
  &lt;/shape&gt;
  </code></pre>
  <p>and I apply it using in my Shape style :</p>
  <pre><code>&lt;item name=&quot;android:background&quot;&gt;@drawable/test&lt;/item&gt;
  </code></pre>
  <p>But the result is the same. Why ?</p>