Browse Source

[android] opinionated UI changes for startup and first-out of the box experience

Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/2799/head
lizzie 4 months ago
committed by crueter
parent
commit
126abbc7b6
  1. 2
      src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/Settings.kt
  2. 17
      src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt
  3. 16
      src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt
  4. 2
      src/android/app/src/main/res/layout/fragment_folders.xml
  5. 6
      src/android/app/src/main/res/values/strings.xml

2
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_FIRST_APP_LAUNCH = "FirstApplicationLaunch"
const val PREF_SHOULD_SHOW_DRIVER_WARNING = "ShouldShowDriverWarning" 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 PREF_MEMORY_WARNING_SHOWN = "MemoryWarningShown"
const val SECTION_STATS_OVERLAY = "Stats Overlay" const val SECTION_STATS_OVERLAY = "Stats Overlay"

17
src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt

@ -96,19 +96,6 @@ class SetupFragment : Fragment() {
val pages = mutableListOf<SetupPage>() val pages = mutableListOf<SetupPage>()
pages.apply { 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) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
add( add(
SetupPage( SetupPage(
@ -198,7 +185,7 @@ class SetupFragment : Fragment() {
R.string.games_description, R.string.games_description,
R.drawable.ic_add, R.drawable.ic_add,
true, true,
R.string.add_games,
R.string.add_games_folder,
{ {
gamesDirCallback = it gamesDirCallback = it
getGamesDirectory.launch(Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data) getGamesDirectory.launch(Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data)
@ -216,6 +203,8 @@ class SetupFragment : Fragment() {
} }
) )
) )
// Needed because finishSetup()
add( add(
SetupPage( SetupPage(
R.drawable.ic_check, R.drawable.ic_check,

16
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() { 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( MessageDialogFragment.newInstance(
this,
titleId = R.string.keys_missing, titleId = R.string.keys_missing,
descriptionId = R.string.keys_missing_description, 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) ).show(supportFragmentManager, MessageDialogFragment.TAG)
} }
} }

2
src/android/app/src/main/res/layout/fragment_folders.xml

@ -43,7 +43,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:contentDescription="@string/add_games"
android:contentDescription="@string/add_games_folder"
app:srcCompat="@drawable/ic_add" app:srcCompat="@drawable/ic_add"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintEnd_toEndOf="parent" />

6
src/android/app/src/main/res/values/strings.xml

@ -238,8 +238,6 @@
<string name="multiplayer_unlisted_visibility">Unlisted</string> <string name="multiplayer_unlisted_visibility">Unlisted</string>
<!-- Setup strings --> <!-- Setup strings -->
<string name="welcome">Welcome!</string>
<string name="welcome_description">Learn how to setup &lt;b>Eden&lt;/b> and jump into emulation.</string>
<string name="get_started">Get started</string> <string name="get_started">Get started</string>
<string name="keys">Keys</string> <string name="keys">Keys</string>
<string name="keys_description">Select your &lt;b>prod.keys&lt;/b> file with the button below.</string> <string name="keys_description">Select your &lt;b>prod.keys&lt;/b> file with the button below.</string>
@ -249,12 +247,10 @@
<string name="select_firmware">Select Firmware</string> <string name="select_firmware">Select Firmware</string>
<string name="games">Games</string> <string name="games">Games</string>
<string name="games_description">Select your &lt;b>Games&lt;/b> folder with the button below.</string> <string name="games_description">Select your &lt;b>Games&lt;/b> folder with the button below.</string>
<string name="done">Done</string>
<string name="done_description">You\'re all set.\nEnjoy your games!</string>
<string name="text_continue">Continue</string> <string name="text_continue">Continue</string>
<string name="next">Next</string> <string name="next">Next</string>
<string name="back">Back</string> <string name="back">Back</string>
<string name="add_games">Add Games</string>
<string name="add_games_folder">Add Folder</string>
<string name="step_complete">Complete!</string> <string name="step_complete">Complete!</string>
<!-- Home strings --> <!-- Home strings -->

Loading…
Cancel
Save