Browse Source

no need for 5 separate "learn more"

Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/2799/head
lizzie 4 months ago
committed by crueter
parent
commit
23b9aa44d4
  1. 25
      src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupFragment.kt
  2. 8
      src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt
  3. 1
      src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt

25
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, R.string.notification_warning_description,
0, 0,
{ {
if (NotificationManagerCompat.from(requireContext())
.areNotificationsEnabled()
) {
if (NotificationManagerCompat.from(requireContext()).areNotificationsEnabled()) {
StepState.COMPLETE StepState.COMPLETE
} else { } else {
StepState.INCOMPLETE StepState.INCOMPLETE
@ -141,7 +139,7 @@ class SetupFragment : Fragment() {
true, true,
R.string.install_prod_keys_warning, R.string.install_prod_keys_warning,
R.string.install_prod_keys_warning_description, R.string.install_prod_keys_warning_description,
R.string.install_prod_keys_warning_help,
0,
{ {
val file = File(DirectoryInitialization.userDirectory + "/keys/prod.keys") val file = File(DirectoryInitialization.userDirectory + "/keys/prod.keys")
if (file.exists() && NativeLibrary.areKeysPresent()) { if (file.exists() && NativeLibrary.areKeysPresent()) {
@ -167,7 +165,7 @@ class SetupFragment : Fragment() {
true, true,
R.string.install_firmware_warning, R.string.install_firmware_warning,
R.string.install_firmware_warning_description, R.string.install_firmware_warning_description,
R.string.install_firmware_warning_help,
0,
{ {
if (NativeLibrary.isFirmwareAvailable()) { if (NativeLibrary.isFirmwareAvailable()) {
StepState.COMPLETE StepState.COMPLETE
@ -193,7 +191,7 @@ class SetupFragment : Fragment() {
true, true,
R.string.add_games_warning, R.string.add_games_warning,
R.string.add_games_warning_description, R.string.add_games_warning_description,
R.string.add_games_warning_help,
0,
{ {
if (NativeConfig.getGameDirs().isNotEmpty()) { if (NativeConfig.getGameDirs().isNotEmpty()) {
StepState.COMPLETE StepState.COMPLETE
@ -239,19 +237,16 @@ class SetupFragment : Fragment() {
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
super.onPageSelected(position) 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) ViewUtils.hideView(binding.buttonBack)
} else {
ViewUtils.showView(binding.buttonBack)
}
if (position == pages.size - 1) {
ViewUtils.hideView(binding.buttonNext) 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) ViewUtils.showView(binding.buttonNext)
} }
previousPosition = position previousPosition = position
} }
}) })

8
src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SetupWarningDialogFragment.kt

@ -46,14 +46,6 @@ class SetupWarningDialogFragment : DialogFragment() {
if (descriptionId != 0) { if (descriptionId != 0) {
builder.setMessage(descriptionId) 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() return builder.show()
} }

1
src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt

@ -210,7 +210,6 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
this, 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,
positiveButtonTitleId = R.string.dont_show_again, positiveButtonTitleId = R.string.dont_show_again,
negativeButtonTitleId = R.string.close, negativeButtonTitleId = R.string.close,
showNegativeButton = true, showNegativeButton = true,

Loading…
Cancel
Save