From 74d75505e95a46213cc57253dcc7b072634f7799 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Fri, 21 Jan 2022 12:19:39 +0100 Subject: [PATCH] `AppListItem` misc tweaks * Restore text marquee on all layouts * Text size and color tweaks * List layout image has round corners * Clean up unneeded attributes --- .../main/java/emu/skyline/adapter/AppViewItem.kt | 3 +++ app/src/main/res/layout/app_item_grid.xml | 5 ++++- app/src/main/res/layout/app_item_grid_compact.xml | 13 +++++-------- app/src/main/res/layout/app_item_linear.xml | 14 +++++++++----- app/src/main/res/values/attrs.xml | 4 +++- app/src/main/res/values/dimens.xml | 1 + app/src/main/res/values/styles.xml | 8 +------- app/src/main/res/values/themes.xml | 5 +++-- 8 files changed, 29 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/emu/skyline/adapter/AppViewItem.kt b/app/src/main/java/emu/skyline/adapter/AppViewItem.kt index bc5fbc58..2ae900dd 100644 --- a/app/src/main/java/emu/skyline/adapter/AppViewItem.kt +++ b/app/src/main/java/emu/skyline/adapter/AppViewItem.kt @@ -87,6 +87,9 @@ class AppViewItem(var layoutType : LayoutType, private val item : AppItem, priva override fun bind(binding : LayoutBinding<*>, position : Int) { binding.textTitle.text = item.title binding.textSubtitle.text = item.subTitle ?: item.loaderResultString(binding.root.context) + // Make the title text view selected for marquee to work + binding.textTitle.isSelected = true + binding.textSubtitle.isSelected = true binding.icon.setImageBitmap(item.icon ?: missingIcon) diff --git a/app/src/main/res/layout/app_item_grid.xml b/app/src/main/res/layout/app_item_grid.xml index c5c86d80..14b2ac03 100644 --- a/app/src/main/res/layout/app_item_grid.xml +++ b/app/src/main/res/layout/app_item_grid.xml @@ -37,7 +37,8 @@ android:marqueeRepeatLimit="marquee_forever" android:singleLine="true" android:textColor="?android:attr/textColorPrimary" - android:textSize="12sp" + android:textAppearance="?android:attr/textAppearanceListItem" + android:textSize="14sp" tools:text="Title" /> diff --git a/app/src/main/res/layout/app_item_grid_compact.xml b/app/src/main/res/layout/app_item_grid_compact.xml index 8a823407..be07c006 100644 --- a/app/src/main/res/layout/app_item_grid_compact.xml +++ b/app/src/main/res/layout/app_item_grid_compact.xml @@ -33,16 +33,14 @@ android:id="@+id/text_title" android:layout_width="0dp" android:layout_height="wrap_content" - android:alpha="242.25" + android:paddingHorizontal="8dp" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" - android:paddingStart="8dp" - android:paddingEnd="8dp" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceListItem" + android:textSize="14sp" android:textColor="@android:color/white" android:textStyle="bold" - app:layout_constrainedWidth="true" app:layout_constraintBottom_toTopOf="@id/text_subtitle" app:layout_constraintEnd_toEndOf="@id/icon" app:layout_constraintStart_toStartOf="@id/icon" @@ -52,16 +50,15 @@ android:id="@+id/text_subtitle" android:layout_width="0dp" android:layout_height="wrap_content" + android:paddingHorizontal="8dp" android:layout_marginBottom="8dp" - android:alpha="242.25" android:ellipsize="marquee" - android:fadingEdge="horizontal" android:marqueeRepeatLimit="marquee_forever" - android:paddingStart="8dp" - android:paddingEnd="8dp" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceListItemSecondary" + android:textSize="12sp" android:textColor="@android:color/white" + android:alpha="0.95" app:layout_constraintBottom_toBottomOf="@id/icon" app:layout_constraintEnd_toEndOf="@id/icon" app:layout_constraintStart_toStartOf="@id/icon" diff --git a/app/src/main/res/layout/app_item_linear.xml b/app/src/main/res/layout/app_item_linear.xml index 7fbf68a7..848a4efd 100644 --- a/app/src/main/res/layout/app_item_linear.xml +++ b/app/src/main/res/layout/app_item_linear.xml @@ -10,7 +10,7 @@ android:focusable="true" android:padding="16dp"> - diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 0b5be5c4..9963bc22 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -1,9 +1,11 @@ + + - + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 6d1c25e3..247fbb1a 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,4 +1,5 @@ 8dp + 8dp diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index e9818aa1..c7c9f300 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -3,19 +3,13 @@ - - diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index ce853a11..3710a2d1 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -3,9 +3,10 @@