From 84db3351abd70cb11430b83d8c5224607169f2ad Mon Sep 17 00:00:00 2001 From: kleidis Date: Fri, 31 Oct 2025 17:23:15 +0100 Subject: [PATCH] [android] Various UX fixups / Improvements (#2870) - Swap import / export icons on InstallablesFragment and GamePropertiesFragment - Redesign AddonFragment - Fix up colors for multiplayer bottom sheets - Fix up padding in multiplayer lobby browser Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2870 Reviewed-by: Lizzie Reviewed-by: crueter Reviewed-by: MaranBr Co-authored-by: kleidis Co-committed-by: kleidis --- .../yuzu/yuzu_emu/adapters/AddonAdapter.kt | 17 ++- .../app/src/main/res/layout/dialog_chat.xml | 13 +- .../main/res/layout/dialog_lobby_browser.xml | 45 ++++-- .../res/layout/dialog_multiplayer_connect.xml | 27 +++- .../res/layout/dialog_multiplayer_lobby.xml | 3 +- .../res/layout/dialog_multiplayer_room.xml | 6 +- .../src/main/res/layout/item_lobby_room.xml | 12 +- .../src/main/res/layout/list_item_addon.xml | 139 ++++++++++++------ .../app/src/main/res/values/strings.xml | 3 +- 9 files changed, 183 insertions(+), 82 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/AddonAdapter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/AddonAdapter.kt index ff254d9b77..2be91ba46a 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/AddonAdapter.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/AddonAdapter.kt @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -20,18 +23,22 @@ class AddonAdapter(val addonViewModel: AddonViewModel) : inner class AddonViewHolder(val binding: ListItemAddonBinding) : AbstractViewHolder(binding) { override fun bind(model: Patch) { - binding.root.setOnClickListener { - binding.addonCheckbox.isChecked = !binding.addonCheckbox.isChecked + binding.addonCard.setOnClickListener { + binding.addonSwitch.performClick() } binding.title.text = model.name binding.version.text = model.version - binding.addonCheckbox.setOnCheckedChangeListener { _, checked -> + binding.addonSwitch.isChecked = model.enabled + + binding.addonSwitch.setOnCheckedChangeListener { _, checked -> model.enabled = checked } - binding.addonCheckbox.isChecked = model.enabled - binding.buttonDelete.setOnClickListener { + + val deleteAction = { addonViewModel.setAddonToDelete(model) } + binding.deleteCard.setOnClickListener { deleteAction() } + binding.buttonDelete.setOnClickListener { deleteAction() } } } } diff --git a/src/android/app/src/main/res/layout/dialog_chat.xml b/src/android/app/src/main/res/layout/dialog_chat.xml index d62ef0802c..905d87a6eb 100644 --- a/src/android/app/src/main/res/layout/dialog_chat.xml +++ b/src/android/app/src/main/res/layout/dialog_chat.xml @@ -4,7 +4,8 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="16dp"> + android:padding="16dp" + android:background="?attr/colorSurface"> + android:layout_marginBottom="16dp" + android:textColor="?attr/colorOnSurface" /> + android:imeOptions="actionSend" + android:textColor="?attr/colorOnSurface" + android:textColorHint="?attr/colorOnSurfaceVariant" /> @@ -50,6 +54,7 @@ android:layout_gravity="bottom" android:background="?attr/selectableItemBackgroundBorderless" android:src="@drawable/ic_send" - android:contentDescription="@string/send_message" /> + android:contentDescription="@string/send_message" + app:tint="?attr/colorPrimary" /> \ No newline at end of file diff --git a/src/android/app/src/main/res/layout/dialog_lobby_browser.xml b/src/android/app/src/main/res/layout/dialog_lobby_browser.xml index 138d099601..7ecbb17340 100644 --- a/src/android/app/src/main/res/layout/dialog_lobby_browser.xml +++ b/src/android/app/src/main/res/layout/dialog_lobby_browser.xml @@ -3,13 +3,14 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:background="?attr/colorSurface"> + android:textAppearance="@style/TextAppearance.Material3.TitleLarge" + android:textColor="?attr/colorOnSurface" /> + app:cardCornerRadius="24dp" + app:cardBackgroundColor="?attr/colorSurfaceVariant"> + android:maxLines="1" + android:textColor="?attr/colorOnSurface" + android:autofillHints="" /> @@ -113,6 +119,7 @@ android:layout_marginEnd="48dp" android:background="?attr/selectableItemBackground" android:src="@drawable/ic_clear" + android:contentDescription="@string/clear" android:visibility="invisible" app:tint="?attr/colorOnSurfaceVariant" tools:visibility="visible" /> @@ -154,19 +161,33 @@ android:id="@+id/chip_hide_empty" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginEnd="8dp" android:checkable="true" android:checked="false" android:text="@string/multiplayer_hide_empty_rooms" - app:chipCornerRadius="16dp" /> + app:chipCornerRadius="16dp" + app:chipIconTint="?attr/colorOnSurface" + app:chipIconSize="18dp" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:paddingTop="6dp" + android:paddingBottom="6dp" /> + app:chipCornerRadius="16dp" + app:chipIconTint="?attr/colorOnSurface" + app:chipIconSize="18dp" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:paddingTop="6dp" + android:paddingBottom="6dp" /> @@ -198,6 +219,7 @@ android:layout_height="72dp" android:layout_marginBottom="16dp" android:src="@drawable/ic_refresh" + android:contentDescription="@string/refresh" android:alpha="0.5" app:tint="?attr/colorOnSurface" /> @@ -205,14 +227,16 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/multiplayer_no_rooms_found" - android:textAppearance="@style/TextAppearance.Material3.TitleMedium" /> + android:textAppearance="@style/TextAppearance.Material3.TitleMedium" + android:textColor="?attr/colorOnSurface" /> + android:textAppearance="@style/TextAppearance.Material3.BodyMedium" + android:textColor="?attr/colorOnSurface" /> + app:icon="@drawable/ic_refresh" + style="@style/Widget.Material3.Button.ElevatedButton" /> \ No newline at end of file diff --git a/src/android/app/src/main/res/layout/dialog_multiplayer_connect.xml b/src/android/app/src/main/res/layout/dialog_multiplayer_connect.xml index a33f65896e..f283c01d3d 100644 --- a/src/android/app/src/main/res/layout/dialog_multiplayer_connect.xml +++ b/src/android/app/src/main/res/layout/dialog_multiplayer_connect.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:background="@drawable/theme_dialog_background"> + app:icon="@drawable/ic_search" + app:iconPadding="12dp" /> + app:icon="@drawable/ic_install" + app:iconPadding="12dp" /> + app:icon="@drawable/ic_add" + app:iconPadding="12dp" /> diff --git a/src/android/app/src/main/res/layout/dialog_multiplayer_lobby.xml b/src/android/app/src/main/res/layout/dialog_multiplayer_lobby.xml index 19368bc2cc..db5f2886ed 100644 --- a/src/android/app/src/main/res/layout/dialog_multiplayer_lobby.xml +++ b/src/android/app/src/main/res/layout/dialog_multiplayer_lobby.xml @@ -1,7 +1,8 @@ + android:layout_height="match_parent" + android:background="@drawable/theme_dialog_background"> + android:layout_height="match_parent" + android:background="@drawable/theme_dialog_background"> + android:layout_gravity="center" + style="@style/Widget.Material3.Button.ElevatedButton" /> \ No newline at end of file diff --git a/src/android/app/src/main/res/layout/item_lobby_room.xml b/src/android/app/src/main/res/layout/item_lobby_room.xml index b69090e212..107ba4dc0c 100644 --- a/src/android/app/src/main/res/layout/item_lobby_room.xml +++ b/src/android/app/src/main/res/layout/item_lobby_room.xml @@ -8,7 +8,7 @@ android:layout_marginBottom="24dp" android:layout_marginHorizontal="12dp" android:background="?attr/selectableItemBackground" - android:backgroundTint="?attr/colorSurfaceVariant" + app:cardBackgroundColor="?attr/colorSurfaceVariant" android:clickable="true" android:focusable="true"> @@ -46,6 +46,7 @@ android:textAlignment="viewStart" android:textSize="16sp" android:textStyle="bold" + android:textColor="?attr/colorOnSurface" tools:text="Room Name" /> + android:src="@drawable/ic_controller" + app:tint="?attr/colorOnSurfaceVariant" /> @@ -98,7 +102,7 @@ android:layout_height="16dp" android:src="@drawable/ic_user" android:contentDescription="@string/multiplayer_player_count" - app:tint="?attr/colorAccent" /> + app:tint="?attr/colorPrimary" /> diff --git a/src/android/app/src/main/res/layout/list_item_addon.xml b/src/android/app/src/main/res/layout/list_item_addon.xml index 9b1c0e6fcc..861d98d989 100644 --- a/src/android/app/src/main/res/layout/list_item_addon.xml +++ b/src/android/app/src/main/res/layout/list_item_addon.xml @@ -2,68 +2,109 @@ + android:padding="8dp"> - + app:layout_constraintEnd_toStartOf="@+id/delete_card" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"> - + android:paddingStart="16dp" + android:paddingEnd="12dp" + android:paddingTop="12dp" + android:paddingBottom="12dp"> - + - + - + -