From d416edc7d8276137821fd771f03d5842eba39990 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 17 Apr 2016 18:13:26 -0700 Subject: [PATCH] Change splash screen preferences button to a reset-preferences button - Reset should be the only thing potentially needed from the splash screen (and even then hopefully not). The main preferences menus can be accessed after starting emulation via back button or top right touch menu --- .../deadc0de/apple2ix/Apple2SplashScreen.java | 17 +++++++++++++---- .../main/res/layout/activity_splash_screen.xml | 6 +++--- Android/app/src/main/res/values/strings.xml | 4 ++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2SplashScreen.java b/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2SplashScreen.java index 03f82bf4..da13bd71 100644 --- a/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2SplashScreen.java +++ b/Android/app/src/main/java/org/deadc0de/apple2ix/Apple2SplashScreen.java @@ -11,7 +11,9 @@ package org.deadc0de.apple2ix; +import android.app.AlertDialog; import android.content.Context; +import android.content.DialogInterface; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; @@ -44,12 +46,19 @@ public class Apple2SplashScreen implements Apple2MenuView { } }); - Button prefsButton = (Button) mSettingsView.findViewById(R.id.prefsButton); + Button prefsButton = (Button) mSettingsView.findViewById(R.id.resetButton); prefsButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Apple2SettingsMenu settingsMenu = mActivity.getSettingsMenu(); - settingsMenu.show(); + AlertDialog.Builder builder = new AlertDialog.Builder(mActivity).setIcon(R.drawable.ic_launcher).setCancelable(true).setTitle(R.string.preferences_reset_really).setMessage(R.string.preferences_reset_warning).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + Apple2Preferences.reset(mActivity); + } + }).setNegativeButton(R.string.no, null); + AlertDialog dialog = builder.create(); + mActivity.registerAndShowDialog(dialog); } }); @@ -70,7 +79,7 @@ public class Apple2SplashScreen implements Apple2MenuView { public void run() { Button startButton = (Button) mSettingsView.findViewById(R.id.startButton); startButton.setEnabled(mDismissable); - Button prefsButton = (Button) mSettingsView.findViewById(R.id.prefsButton); + Button prefsButton = (Button) mSettingsView.findViewById(R.id.resetButton); prefsButton.setEnabled(mDismissable); Button disksButton = (Button) mSettingsView.findViewById(R.id.disksButton); disksButton.setEnabled(mDismissable); diff --git a/Android/app/src/main/res/layout/activity_splash_screen.xml b/Android/app/src/main/res/layout/activity_splash_screen.xml index f5e0e3c1..90bebdb4 100644 --- a/Android/app/src/main/res/layout/activity_splash_screen.xml +++ b/Android/app/src/main/res/layout/activity_splash_screen.xml @@ -45,8 +45,8 @@