At the moment, there is no clear way to achieve this look of linear progress bar below the toolbar: https://material.io/design/components/progress-indicators.html
Stackoverflow related issue: https://stackoverflow.com/questions/37469452/how-to-get-a-progress-bar-under-the-actionbar-in-material-design
The paddings issue: https://stackoverflow.com/questions/14171471/remove-vertical-padding-from-horizontal-progressbar
Basically, this library shouldn't exist: https://github.com/DreaminginCodeZH/MaterialProgressBar
I think you can accomplish this already with a normal ProgressBar with the Horizontal style.
<ProgressBar
android:id="@+id/progress_bar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="4dp"
android:scaleY="4"
android:indeterminate="true" />
@froriz5 Thank you, that's actually pretty close! Still, there is small padding on the top, but that's probably because of the arithmetic rounding, not sure (I exaggerated the height to make it visible). The discoverability of this hackish solution is quite low tho. The only reason scaleY="4" works is because the height of the bar is set to 16dp internally and the progress drawable is 1/4 of this height: <dimen name="progress_bar_height_material">4dp</dimen> (from SDK source code). So we scale it up, to fill the whole height. It's a pretty tall ask to require from people to know this stuff in order to make the widget compliant with the guidelines.

@Ghedeon I did something similar: https://github.com/gfroerli/app-android/commit/24c82340d3333bd451f5552b24132f0c73849a3d

<ProgressBar
android:id="@+id/loadingbar"
style="@android:style/Widget.Holo.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="6dp"
android:minHeight="6dp"
android:maxHeight="6dp"
android:scaleY="2"
android:layout_margin="0dp"
android:padding="0dp"
android:indeterminate="true"
android:visibility="invisible"/>
It's close to the guidelines, but still far from ideal.
I'm also looking forward to an implementation of #83.
@dbrgn this is a KitKat progress bar. I don't think you want this in a material styled app these days.
Yes, you're right @Ghedeon, the MaterialProgressBar library should not exist. However, I am using it in my app because I have to, and there is no other way to put a progress bar under the toolbar. This should be implemented here!
Duplicate of #83
Most helpful comment
@dbrgn this is a KitKat progress bar. I don't think you want this in a material styled app these days.