From aa3e2b48f7934e5509f95692958348a492e06d6d Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 20 Oct 2025 07:09:17 +0000 Subject: [PATCH 1/5] [android] opinionated UI changes for startup and first-out of the box experience Signed-off-by: lizzie --- .../features/settings/model/Settings.kt | 2 ++ .../yuzu/yuzu_emu/fragments/SetupFragment.kt | 17 +++-------------- .../org/yuzu/yuzu_emu/ui/main/MainActivity.kt | 16 ++++++++++++++-- .../src/main/res/layout/fragment_folders.xml | 2 +- src/android/app/src/main/res/values/strings.xml | 6 +----- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt index 27682e329b..fbe32df727 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt @@ -35,6 +35,8 @@ object Settings { const val PREF_FIRST_APP_LAUNCH = "FirstApplicationLaunch" const val PREF_SHOULD_SHOW_DRIVER_WARNING = "ShouldShowDriverWarning" + const val PREF_SHOULD_SHOW_KEYS_MISSING_WARNING = "ShouldShowKeysMissingWarning" + const val PREF_SHOULD_SHOW_EDENS_VEIL_DIALOG = "ShouldShowEdensVeilDialog" const val PREF_MEMORY_WARNING_SHOWN = "MemoryWarningShown" const val SECTION_STATS_OVERLAY = "Stats Overlay" diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt index eff96248e0..1aa249c417 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt @@ -96,19 +96,6 @@ class SetupFragment : Fragment() { val pages = mutableListOf() pages.apply { - add( - SetupPage( - R.drawable.ic_yuzu_title, - R.string.welcome, - R.string.welcome_description, - 0, - true, - R.string.get_started, - { pageForward() }, - false - ) - ) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { add( SetupPage( @@ -198,7 +185,7 @@ class SetupFragment : Fragment() { R.string.games_description, R.drawable.ic_add, true, - R.string.add_games, + R.string.add_games_folder, { gamesDirCallback = it getGamesDirectory.launch(Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data) @@ -216,6 +203,8 @@ class SetupFragment : Fragment() { } ) ) + + // Needed because finishSetup() add( SetupPage( R.drawable.ic_check, diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt index 126d85d715..e52709a0b5 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt @@ -202,11 +202,23 @@ class MainActivity : AppCompatActivity(), ThemeProvider { } private fun checkKeys() { - if (!NativeLibrary.areKeysPresent()) { + val shouldDisplayKeysMissingWarning = + PreferenceManager.getDefaultSharedPreferences(applicationContext) + .getBoolean(Settings.PREF_SHOULD_SHOW_KEYS_MISSING_WARNING, true) + if (shouldDisplayKeysMissingWarning && !NativeLibrary.areKeysPresent()) { MessageDialogFragment.newInstance( + this, titleId = R.string.keys_missing, descriptionId = R.string.keys_missing_description, - helpLinkId = R.string.keys_missing_help + helpLinkId = R.string.keys_missing_help, + positiveButtonTitleId = R.string.dont_show_again, + negativeButtonTitleId = R.string.close, + showNegativeButton = true, + positiveAction = { + PreferenceManager.getDefaultSharedPreferences(applicationContext).edit() { + putBoolean(Settings.PREF_SHOULD_SHOW_KEYS_MISSING_WARNING, false) + } + } ).show(supportFragmentManager, MessageDialogFragment.TAG) } } diff --git a/src/android/app/src/main/res/layout/fragment_folders.xml b/src/android/app/src/main/res/layout/fragment_folders.xml index b5c7676d88..00c0c6e2af 100644 --- a/src/android/app/src/main/res/layout/fragment_folders.xml +++ b/src/android/app/src/main/res/layout/fragment_folders.xml @@ -43,7 +43,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" - android:contentDescription="@string/add_games" + android:contentDescription="@string/add_games_folder" app:srcCompat="@drawable/ic_add" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index ac9e6bc2c5..1dd193571c 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -238,8 +238,6 @@ Unlisted - Welcome! - Learn how to setup <b>Eden</b> and jump into emulation. Get started Keys Select your <b>prod.keys</b> file with the button below. @@ -249,12 +247,10 @@ Select Firmware Games Select your <b>Games</b> folder with the button below. - Done - You\'re all set.\nEnjoy your games! Continue Next Back - Add Games + Add Folder Complete! From 40f768ec9da309379e9a382fc7466726f328e90c Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 20 Oct 2025 07:17:59 +0000 Subject: [PATCH 2/5] restore strings Signed-off-by: lizzie --- src/android/app/src/main/res/values/strings.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 1dd193571c..35474fa98c 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -238,6 +238,8 @@ Unlisted + Welcome! + Learn how to setup <b>Eden</b> and jump into emulation. Get started Keys Select your <b>prod.keys</b> file with the button below. @@ -247,10 +249,12 @@ Select Firmware Games Select your <b>Games</b> folder with the button below. + Done + You\'re all set.\nEnjoy your games! Continue Next Back - Add Folder + Add Games Complete! @@ -262,6 +266,8 @@ Carousel Screenshot for %1$s Folder + Pre-Alpha Software + WARNING: This software is in the pre-alpha stage and may have bugs and incomplete feature implementations. Don\'t Show Again New game directory added successfully Check for updates on app startup. From 8641c9b3215ecd26fa1eb4e8e0e93f147810c349 Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 20 Oct 2025 07:22:50 +0000 Subject: [PATCH 3/5] fine no custom strings either Signed-off-by: lizzie --- .../src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt | 2 +- src/android/app/src/main/res/layout/fragment_folders.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt index 1aa249c417..cf90c49047 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt @@ -185,7 +185,7 @@ class SetupFragment : Fragment() { R.string.games_description, R.drawable.ic_add, true, - R.string.add_games_folder, + R.string.add_games, { gamesDirCallback = it getGamesDirectory.launch(Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data) diff --git a/src/android/app/src/main/res/layout/fragment_folders.xml b/src/android/app/src/main/res/layout/fragment_folders.xml index 00c0c6e2af..b5c7676d88 100644 --- a/src/android/app/src/main/res/layout/fragment_folders.xml +++ b/src/android/app/src/main/res/layout/fragment_folders.xml @@ -43,7 +43,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" - android:contentDescription="@string/add_games_folder" + android:contentDescription="@string/add_games" app:srcCompat="@drawable/ic_add" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> From dcf507cecd048339e5b09f969aa2e98fe4f0212a Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 20 Oct 2025 07:55:24 +0000 Subject: [PATCH 4/5] no need for 5 separate "learn more" Signed-off-by: lizzie --- .../yuzu/yuzu_emu/fragments/SetupFragment.kt | 25 ++++++++----------- .../fragments/SetupWarningDialogFragment.kt | 8 ------ .../org/yuzu/yuzu_emu/ui/main/MainActivity.kt | 1 - 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt index cf90c49047..4cf9cedd03 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt @@ -114,9 +114,7 @@ class SetupFragment : Fragment() { R.string.notification_warning_description, 0, { - if (NotificationManagerCompat.from(requireContext()) - .areNotificationsEnabled() - ) { + if (NotificationManagerCompat.from(requireContext()).areNotificationsEnabled()) { StepState.COMPLETE } else { StepState.INCOMPLETE @@ -141,7 +139,7 @@ class SetupFragment : Fragment() { true, R.string.install_prod_keys_warning, R.string.install_prod_keys_warning_description, - R.string.install_prod_keys_warning_help, + 0, { val file = File(DirectoryInitialization.userDirectory + "/keys/prod.keys") if (file.exists() && NativeLibrary.areKeysPresent()) { @@ -167,7 +165,7 @@ class SetupFragment : Fragment() { true, R.string.install_firmware_warning, R.string.install_firmware_warning_description, - R.string.install_firmware_warning_help, + 0, { if (NativeLibrary.isFirmwareAvailable()) { StepState.COMPLETE @@ -193,7 +191,7 @@ class SetupFragment : Fragment() { true, R.string.add_games_warning, R.string.add_games_warning_description, - R.string.add_games_warning_help, + 0, { if (NativeConfig.getGameDirs().isNotEmpty()) { StepState.COMPLETE @@ -239,19 +237,16 @@ class SetupFragment : Fragment() { override fun onPageSelected(position: Int) { super.onPageSelected(position) - - if (position == 1 && previousPosition == 0) { - ViewUtils.showView(binding.buttonNext) - ViewUtils.showView(binding.buttonBack) - } else if (position == 0 && previousPosition == 1) { + if (position == 0) { ViewUtils.hideView(binding.buttonBack) + } else { + ViewUtils.showView(binding.buttonBack) + } + if (position == pages.size - 1) { ViewUtils.hideView(binding.buttonNext) - } else if (position == pages.size - 1 && previousPosition == pages.size - 2) { - ViewUtils.hideView(binding.buttonNext) - } else if (position == pages.size - 2 && previousPosition == pages.size - 1) { + } else { ViewUtils.showView(binding.buttonNext) } - previousPosition = position } }) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt index b2c1d54af3..d085288b2c 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt @@ -46,14 +46,6 @@ class SetupWarningDialogFragment : DialogFragment() { if (descriptionId != 0) { builder.setMessage(descriptionId) } - if (helpLinkId != 0) { - builder.setNeutralButton(R.string.warning_help) { _: DialogInterface?, _: Int -> - val helpLink = resources.getString(R.string.install_prod_keys_warning_help) - val intent = Intent(Intent.ACTION_VIEW, Uri.parse(helpLink)) - startActivity(intent) - } - } - return builder.show() } diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt index e52709a0b5..42aaf1d890 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt @@ -210,7 +210,6 @@ class MainActivity : AppCompatActivity(), ThemeProvider { this, titleId = R.string.keys_missing, descriptionId = R.string.keys_missing_description, - helpLinkId = R.string.keys_missing_help, positiveButtonTitleId = R.string.dont_show_again, negativeButtonTitleId = R.string.close, showNegativeButton = true, From bc78612fa736bdf533c0bbea654a1ad493146dc2 Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 20 Oct 2025 09:24:19 +0000 Subject: [PATCH 5/5] fix Signed-off-by: lizzie --- .../org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt index d085288b2c..e15b7e9451 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.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