LinearProgressIndicator: Fixes for new M3 design

* Since 1.12.0, LinearProgressIndicator uses new M3 design that doesn't plays well with install and ratings for us
* Switch both back to old style using new Widget.Material3.LinearProgressIndicator.Legacy style
* Additionally drop trackCornerRadius and switch to custom background with clipToOutline for download as the class
  now has a bug that messes with style

Keep downloads to follow new M3 design

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2024-06-13 21:40:14 +05:30
parent 7c0e258d58
commit 7f32b9078e
4 changed files with 9 additions and 1 deletions

View File

@@ -237,6 +237,7 @@ class AppDetailsFragment : BaseFragment(R.layout.fragment_details) {
}
// Downloads
binding.layoutDetailsInstall.progressDownload.clipToOutline = true
binding.layoutDetailsInstall.imgCancel.setOnClickListener {
viewModel.cancelDownload(app)
if (downloadStatus != DownloadStatus.DOWNLOADING) flip(0)

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="10dp" />
</shape>

View File

@@ -62,15 +62,16 @@
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress_download"
style="@style/Widget.Material3.LinearProgressIndicator.Legacy"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/img_cancel"
android:background="@drawable/bg_rounded_transparent"
android:indeterminate="true"
android:indeterminateTint="@color/colorScrimAlt"
app:indicatorColor="@color/colorScrimAlt"
app:trackColor="@color/colorScrim"
app:trackCornerRadius="10dp"
app:trackThickness="@dimen/icon_size_small" />
<LinearLayout

View File

@@ -38,6 +38,7 @@
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/avg_rating"
style="@style/Widget.Material3.LinearProgressIndicator.Legacy"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"