title: How to create a custom drawable with diagonal gradient with round edges?
body: <p>Am trying to make a custom drawable using xml, like the attached image <a href="https://i.stack.imgur.com/pdo1y.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pdo1y.png" alt="enter image description here"></a></p>
  
  <p>Below are two approach i have done,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="rectangle"&gt;
  &lt;corners android:radius="30dp" /&gt;
  &lt;solid android:color="@color/colorAccent" /&gt;
  &lt;stroke
      android:width="2dp"
      android:color="@color/colorAccent" /&gt;
  &lt;gradient
      android:angle="135"
      android:endColor="#000"
      android:startColor="#ffff"
      android:type="linear" /&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>By doing like this i can get the effect right, but the colors seems to be merged, I want two colors without any merge effect, then i tried 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:drawable="@color/white"&gt;
      &lt;shape android:shape="oval"&gt;
          &lt;corners android:radius="@dimen/size_30dp" /&gt;
      &lt;/shape&gt;
  &lt;/item&gt;
  &lt;item&gt;
      &lt;rotate
          android:fromDegrees="35"
          android:pivotX="0%"
          android:pivotY="100%"&gt;
          &lt;shape android:shape="rectangle"&gt;
              &lt;solid android:color="@color/textColorGreyExtraLight" /&gt;
          &lt;/shape&gt;
      &lt;/rotate&gt;
  &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>This approach actually messed up the UI, also i have compromise on the rounded edges,</p>
  
  <p>So i there any way i can draw this effect using XML?</p>
  
  <p>Any kind of help will be greatly appreciated. </p>
  
  <p><strong>FYI</strong> The width and height of drawable will vary, so the diagonal should be always left bottom edge to right top edge.</p>
  
  <p>Thanks</p>