title: Generate gradient progress bar
body: <p><img src="https://i.stack.imgur.com/HDSfI.png%60" alt="Gradient Image"></p>
  
  <p>I am using below code for displaying gradient in progress bar. So how to create a gradient progress bar as displayed in the above image? I have tried many solutions but haven't succeeded yet.</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:id="@android:id/background"&gt;
          &lt;shape&gt;
              &lt;corners android:radius="5dip" /&gt;
              &lt;gradient
                  android:startColor="@color/gray"
                  android:centerColor="@color/gray"
                  android:centerY="0.75"
                  android:endColor="@color/gray"
                  android:angle="270"
                  /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  
      &lt;item android:id="@android:id/secondaryProgress"&gt;
          &lt;clip&gt;
              &lt;shape&gt;
                  &lt;corners android:radius="5dip" /&gt;
                  &lt;gradient
                      android:startColor="#80ffd300"
                      android:centerColor="#80ffb600"
                      android:centerY="0.75"
                      android:endColor="#a0ffcb00"
                      android:angle="270"
                      /&gt;
              &lt;/shape&gt;
          &lt;/clip&gt;
      &lt;/item&gt;
      &lt;item
          android:id="@android:id/progress"&gt;
          &lt;clip&gt;
              &lt;shape&gt;
                  &lt;corners
                      android:radius="5dip" /&gt;
                  &lt;gradient
                      android:startColor="@color/dark_yellow"
                      android:endColor="@color/dark_yellow"
                      android:angle="270" /&gt;
              &lt;/shape&gt;
          &lt;/clip&gt;
      &lt;/item&gt;
  
  &lt;/layer-list&gt;
  </code></pre>