title: layer-list background not working for horizontal ProgressBar on Android Lollipop (5.1.1 / API 22)
body: <p>This is my layout XML for my <strong>ProgressBar</strong>:</p>
  
  <pre><code>&lt;ProgressBar
      android:id="@+id/myProgressBar"
  
      style="@style/Widget.AppCompat.ProgressBar.Horizontal"
      android:minHeight="@dimen/my_progress_bar_height"
      android:maxHeight="@dimen/my_progress_bar_height"
      android:progressDrawable="@drawable/my_progress_bar"
      android:indeterminate="false"
  
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_toLeftOf="@id/imageViewSend"
      android:layout_toStartOf="@id/imageViewSend"
      android:max="10"
      android:progress="0"
      android:layout_centerVertical="true"/&gt;
  </code></pre>
  
  <p>And here is the <code>progressDrawable</code> resource, <strong>my_progress_bar.xml</strong>, which should show a pair of lines for the ProgressBar (using four different colours in order to demonstrate the problem):</p>
  
  <p>
  </p>
  
  <pre><code>&lt;item android:id="@android:id/background"&gt;
  
      &lt;layer-list&gt;
          &lt;item android:gravity="top"&gt;
              &lt;shape&gt;
                  &lt;size android:height="@dimen/my_progress_bar_line_width" /&gt;
                  &lt;solid android:color="@color/blue" /&gt;
              &lt;/shape&gt;
          &lt;/item&gt;
          &lt;item android:gravity="bottom"&gt;
              &lt;shape&gt;
                  &lt;size android:height="@dimen/my_progress_bar_line_width" /&gt;
                  &lt;solid android:color="@color/green" /&gt;
              &lt;/shape&gt;
          &lt;/item&gt;
      &lt;/layer-list&gt;
  
  &lt;/item&gt;
  
  &lt;item
      android:id="@android:id/progress"&gt;
      &lt;clip&gt;
          &lt;layer-list&gt;
              &lt;item android:gravity="top"&gt;
                  &lt;shape&gt;
                      &lt;size android:height="@dimen/my_progress_bar_line_width" /&gt;
                      &lt;solid android:color="@color/yellow" /&gt;
                  &lt;/shape&gt;
              &lt;/item&gt;
              &lt;item android:gravity="bottom"&gt;
                  &lt;shape&gt;
                      &lt;size android:height="@dimen/my_progress_bar_line_width" /&gt;
                      &lt;solid android:color="@color/red" /&gt;
                  &lt;/shape&gt;
              &lt;/item&gt;
          &lt;/layer-list&gt;
      &lt;/clip&gt;
  &lt;/item&gt;
  </code></pre>
  
  <p></p>
  
  <p>On an Android Nougat (7.0 / API 24), the ProgressBar looks as intended:</p>
  
  <p><a href="https://i.stack.imgur.com/d8SWW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d8SWW.png" alt="ProgressBar on Android Nougat device"></a></p>
  
  <p>But on an Android Lollipop (5.1.1 / API 22), it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/eZHYW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eZHYW.png" alt="ProgressBar on Android Lollipop device"></a></p>
  
  <p>...i.e., it seems like the widths I specify for the lines are not being respected.</p>
  
  <p>Why is it displaying differently on the Android Lollipop device? And how to make it appear like it does for the Android Nougat device?</p>
  
  <p>(<a href="https://stackoverflow.com/a/36194746/1617737">This answer</a> to a similar question didn't help.)</p>