Improvements to download progress UI
Switch to LinearProgressIndicator where possible and show an indeterminate progress bar while download progress is below 1% Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -60,15 +60,22 @@
|
||||
android:gravity="center_vertical"
|
||||
android:weightSum="4">
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_download"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/icon_size_small"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@id/img_cancel"
|
||||
android:indeterminateTint="@color/colorScrim"
|
||||
android:progressDrawable="@drawable/progressbar_bg"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateTint="@color/colorScrimAlt"
|
||||
app:indicatorColor="@color/colorScrimAlt"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:trackColor="@color/colorScrim"
|
||||
app:trackCornerRadius="10dp"
|
||||
app:trackThickness="@dimen/icon_size_small"
|
||||
tools:progress="40" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -159,4 +166,4 @@
|
||||
android:textColor="@color/colorWhite"
|
||||
tools:text="@string/purchase_invalid" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -52,14 +52,15 @@
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/progress_download"
|
||||
style="@style/Widget.Material3.CircularProgressIndicator"
|
||||
android:layout_width="@dimen/icon_size_medium"
|
||||
android:layout_height="@dimen/icon_size_medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/progressbar_bg"
|
||||
android:indeterminate="false"
|
||||
android:visibility="invisible"
|
||||
app:trackThickness="24dp"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateTint="@color/colorScrimAlt"
|
||||
android:visibility="gone"
|
||||
app:indicatorColor="@color/colorScrimAlt"
|
||||
app:trackColor="@color/colorScrim"
|
||||
app:trackThickness="@dimen/icon_size_default"
|
||||
tools:progress="40" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:paddingStart="@dimen/padding_small"
|
||||
android:paddingEnd="@dimen/padding_small">
|
||||
@@ -61,12 +62,19 @@
|
||||
android:textAlignment="viewStart"
|
||||
tools:text="Status" />
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/progress_download"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="false"
|
||||
android:max="100"
|
||||
app:indicatorColor="@color/colorAccent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:trackColor="@android:color/darker_gray"
|
||||
app:trackCornerRadius="10dp"
|
||||
tools:progress="75" />
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_normal"
|
||||
@@ -34,12 +36,21 @@
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/avg_rating"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="8dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@+id/avg_num"
|
||||
android:progressDrawable="@drawable/bg_progressbar" />
|
||||
android:indeterminate="false"
|
||||
app:indicatorColor="@color/colorAccent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:trackColor="@android:color/darker_gray"
|
||||
app:trackCornerRadius="10dp"
|
||||
app:trackThickness="8dp"
|
||||
tools:progress="40" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
Reference in New Issue
Block a user