From ba274368f8455849d419ce686f36361841e7b891 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 26 Aug 2013 11:58:51 -0400 Subject: [PATCH] [Android] Make the dialog variable in InputConfigFragment a local variable in onPreferenceTreeClick. With the new input UI, this doesn't need to be accessible to other classes. Also change the documentation of the custom dialog class. --- .../dolphinemu/settings/InputConfigFragment.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/InputConfigFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/InputConfigFragment.java index 686aa4b4c7..8c9f6f0be4 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/settings/InputConfigFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/InputConfigFragment.java @@ -35,7 +35,6 @@ public final class InputConfigFragment extends PreferenceFragment private Activity m_activity; private boolean firstEvent = true; private static ArrayList m_values = new ArrayList(); - protected MotionAlertDialog dialog; /** * Gets the descriptor for the given {@link InputDevice}. @@ -47,7 +46,7 @@ public final class InputConfigFragment extends PreferenceFragment public static String getInputDesc(InputDevice input) { if (input == null) - return "null"; // Happens when the inputdevice is from an unknown source + return "null"; // Happens when the InputDevice is from an unknown source if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { @@ -97,7 +96,7 @@ public final class InputConfigFragment extends PreferenceFragment public boolean onPreferenceTreeClick(final PreferenceScreen screen, final Preference pref) { // Begin the creation of the input alert. - dialog = new MotionAlertDialog(m_activity); + final MotionAlertDialog dialog = new MotionAlertDialog(m_activity); // Set the key listener dialog.setOnKeyEventListener(new MotionAlertDialog.OnKeyEventListener() @@ -205,7 +204,9 @@ public final class InputConfigFragment extends PreferenceFragment /** - * {@link AlertDialog} class derivative that can handle motion events. + * {@link AlertDialog} class derivative that allows the motion listener + * to be set anonymously, so the creation of an explicit class for + * providing functionality is not necessary. */ protected static final class MotionAlertDialog extends AlertDialog {