title: CardView: How do I add a gradient background while maintaining the radius
body: <p>I want to re-create the image below with a CardView. To achieve this, I created a gradient file (btn_gradient.xml) and then proceeded to create the CardView.</p>
  
  <p><a href="https://i.stack.imgur.com/I58Ja.png" rel="noreferrer"><img src="https://i.stack.imgur.com/I58Ja.png" alt="enter image description here"></a></p>
  
  <p>CardView implementation:</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="44dp"
          android:layout_margin="25dp"
          app:cardElevation="0dp"
          app:cardCornerRadius="4dp"
          app:cardPreventCornerOverlap="false"&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center"
              android:background="@drawable/btn_gradient"
              android:text="Create Account"
              android:textColor="#000000"
              android:textStyle="bold"
              android:textAllCaps="false"/&gt;
  
  
      &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>Everything works fine this way except that <strong>the radius disappears</strong> and this is not what I want. Is there a way I can set the gradient directly on the CardView? The <code>cardBackgroundColor</code> attribute accepts only colors, not drawables.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p><br /><br /></p>
  
  <p><strong>Addendum:</strong> <br />As requested, this is my btn_gradient.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;gradient
      android:type="linear"
      android:angle="0"
      android:startColor="#ffc200"
      android:endColor="#fca10b" /&gt;
  &lt;/shape&gt;
  </code></pre>