I'm trying to achieve horizontal indeterminate style of progress bar with ContentLoadingProgressBar. Below is the xml layout
<android.support.v4.widget.ContentLoadingProgressBar
android:id="@+id/pbar_Cloud"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_gravity="bottom"
android:visibility="visible" />
The progress bar is displayed as empty horizontal line with no progress. By setting
style="?android:attr/progressBarStyleLarge"
Circular indeterminate progress is shown fine. What am I missing, I have even tried
ContentLoadingProgressBar bar = (ContentLoadingProgressBar) findViewById(R.id.pbar_Cloud);
bar.setActivated(true);
bar.show();
Still no luck.
I know this was asked a long time ago, but in case someone else winds up here with the same problem:
You just need to add android:indeterminate="true"
to your xml:
<android.support.v4.widget.ContentLoadingProgressBar
android:id="@+id/pbar_Cloud"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_gravity="bottom"
android:visibility="visible"
android:indeterminate="true"/>
hope that helps!
Update:
For those of you migrating to AndroidX just update your tag to use
<androidx.core.widget.ContentLoadingProgressBar
...
android:indeterminate="true"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With