Reputation: 1243
I've used "android.material.progressindicator" for the purpose of showing progress in horizontal view but I can't hear my XML
<com.google.android.material.progressindicator.ProgressIndicator
android:background="@color/grey"
android:id="@+id/progressInd"
style="@style/Widget.MaterialComponents.ProgressIndicator.Linear.Determinate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="false"
android:max="100"
android:progress="30"
android:progressDrawable="@drawable/bidding_progress" />
Upvotes: 11
Views: 15480
Reputation: 364780
You can use:
<com.google.android.material.progressindicator.LinearProgressIndicator
app:indicatorColor="?attr/colorPrimary"
app:trackColor="@color/..."
/>
Use progressIndicator.setProgressCompat((int) value, true);
to update the value in the indicator.
Use the attributes:
indicatorColor
to se the color of the color of indicatortrackColor
to set the color of tracktrackThickness
to set the height of the progress barNote: It requires at least the version 1.3.0-alpha04
Upvotes: 20