Styling determinate progress bar is easy, there are many tutorials to achieve that. This is on I'm using:
<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" />
Drawable progress_background.xml
:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="@color/colorAccent" />
<corners android:radius="4dp" />
</shape>
</clip>
</item>
</layer-list>
It looks like this:
But when progress is not available yet, I'd like to use indeterminate one. So I tried:
<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" />
But indeterminate progress is not stretched to bar height:
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).
Desired indeterminate progress bar should look like regular one but with 8dp height and rounded corners.