Styling indeterminate horizontal progress bar on android
<p>Styling determinate progress bar is easy, there are many tutorials to achieve that. This is on I'm using:</p>

<pre><code>&lt;ProgressBar
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="match_parent"
    android:layout_height="8dp"
    android:background="@drawable/progress_background"
    android:progressDrawable="@drawable/progress"
    android:id="@+id/progressBar" /&gt;
</code></pre>

<p>Drawable <code>progress_background.xml</code>:</p>

<pre><code>    &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item android:id="@android:id/progress"&gt;
        &lt;clip&gt;
            &lt;shape&gt;
                &lt;solid android:color="@color/colorAccent" /&gt;
                &lt;corners android:radius="4dp" /&gt;
            &lt;/shape&gt;
        &lt;/clip&gt;
    &lt;/item&gt;
&lt;/layer-list&gt;
</code></pre>

<p>It looks like this:</p>

<p><a href="https://i.stack.imgur.com/g1nCS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g1nCS.png" alt="enter image description here"></a></p>

<p>But when progress is not available yet, I'd like to use indeterminate one. So I tried:</p>

<pre><code>&lt;ProgressBar
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="8dp"
        android:background="@drawable/progress_background"
        android:progressDrawable="@drawable/progress"
        android:indeterminateTint="@color/colorAccent"
        android:indeterminateTintMode="src_in"
        android:indeterminate="true"
        android:id="@+id/progressBar" /&gt;
</code></pre>

<p>But indeterminate progress is not stretched to bar height:</p>

<p><a href="https://i.stack.imgur.com/K9Zo0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/K9Zo0.png" alt="enter image description here"></a></p>

<p>I tried to style it using drawable file as well but it looked like broken determinate progress bar (filling from 0 to 100 all over again).</p>

<p>Desired indeterminate progress bar should look like regular one but with 8dp height and rounded corners.</p>