From a44ec64c01e2724cb8dd19b7449e8375a25c433f Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Wed, 5 Oct 2022 11:51:00 +0600 Subject: [PATCH] updated ui of app list item --- .../ApplicationListRVAdapter.kt | 2 +- app/src/main/res/drawable/ic_star.xml | 32 ++------ .../main/res/layout/application_list_item.xml | 77 ++++++++----------- 3 files changed, 41 insertions(+), 70 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt b/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt index e1897ab3c..0cc118431 100644 --- a/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt @@ -172,7 +172,6 @@ class ApplicationListRVAdapter( private fun ApplicationListItemBinding.updateRating(searchApp: FusedApp) { if (searchApp.ratings.usageQualityScore != -1.0) { appRating.text = searchApp.ratings.usageQualityScore.toString() - appRatingBar.rating = searchApp.ratings.usageQualityScore.toFloat() } } @@ -456,6 +455,7 @@ class ApplicationListRVAdapter( searchApp.isFree -> { materialButton.enableInstallButton() materialButton.text = materialButton.context.getString(R.string.install) + materialButton.strokeColor = ContextCompat.getColorStateList(holder.itemView.context, R.color.light_grey) applicationListItemBinding.progressBarInstall.visibility = View.GONE } else -> { diff --git a/app/src/main/res/drawable/ic_star.xml b/app/src/main/res/drawable/ic_star.xml index 6247df769..7f39de2d9 100644 --- a/app/src/main/res/drawable/ic_star.xml +++ b/app/src/main/res/drawable/ic_star.xml @@ -1,28 +1,10 @@ - - + android:width="14dp" + android:height="13dp" + android:viewportWidth="14" + android:viewportHeight="13"> + android:pathData="M7,10.513L11.12,13L10.027,8.313L13.667,5.16L8.873,4.753L7,0.333L5.127,4.753L0.333,5.16L3.973,8.313L2.88,13L7,10.513Z" + android:fillColor="#FFC300" + android:fillType="evenOdd"/> diff --git a/app/src/main/res/layout/application_list_item.xml b/app/src/main/res/layout/application_list_item.xml index 2205bd5b3..99b2b098e 100644 --- a/app/src/main/res/layout/application_list_item.xml +++ b/app/src/main/res/layout/application_list_item.xml @@ -24,7 +24,7 @@ android:id="@+id/applicationList" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="5dp" + android:layout_margin="10dp" android:background="?android:attr/selectableItemBackground" android:clickable="true" android:focusable="true"> @@ -41,8 +41,8 @@ @@ -78,25 +79,22 @@ android:ellipsize="end" android:maxLines="1" android:textColor="?android:textColorPrimary" - android:textSize="14sp" - app:layout_constraintBottom_toTopOf="@+id/app_rating_bar" + android:alpha=".6" + android:textSize="13sp" + app:layout_constraintTop_toTopOf="@+id/app_icon_card" app:layout_constraintLeft_toLeftOf="@+id/app_title" app:layout_constraintRight_toLeftOf="@+id/installButton" - app:layout_constraintTop_toBottomOf="@+id/app_title" + app:layout_constraintBottom_toBottomOf="@+id/app_icon_card" tools:text="App author" /> - + android:src="@drawable/ic_star" + android:layout_marginBottom="1dp" + app:layout_constraintBottom_toBottomOf="@+id/app_icon_card" + app:layout_constraintLeft_toLeftOf="@+id/app_author"/> + android:textSize="13sp" + app:layout_constraintTop_toTopOf="@+id/icon_star" + app:layout_constraintBottom_toBottomOf="@+id/icon_star" + app:layout_constraintLeft_toRightOf="@+id/icon_star" /> + app:layout_constraintTop_toTopOf="@+id/app_title" /> + app:layout_constraintTop_toTopOf="@+id/sourceTag"> - - - + \ No newline at end of file -- GitLab