How to create a horizontal loading progress bar?
For using the new progress bar
style="?android:attr/progressBarStyleHorizontal"
for the old grey color progress bar use
style="@android:style/Widget.ProgressBar.Horizontal"
in this one you have the option of changing the height by setting minHeight
The complete XML code is:
<ProgressBar
android:id="@+id/pbProcessing"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvProcessing"
android:indeterminateOnly="true"/>
indeterminateOnly is set to true for getting indeterminate horizontal progress bar
Just add a STYLE line and your progress becomes horizontal:
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/progress"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:max="100"
android:progress="45"/>
It is Widget.ProgressBar.Horizontal
on my phone, if I set android:indeterminate="true"