Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Make the dialog variable in InputConfigFragment a local var…
…iable 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.
  • Loading branch information
lioncash committed Aug 26, 2013
1 parent e051935 commit ba27436
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -35,7 +35,6 @@ public final class InputConfigFragment extends PreferenceFragment
private Activity m_activity;
private boolean firstEvent = true;
private static ArrayList<Float> m_values = new ArrayList<Float>();
protected MotionAlertDialog dialog;

/**
* Gets the descriptor for the given {@link InputDevice}.
Expand All @@ -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)
{
Expand Down Expand Up @@ -97,7 +96,7 @@ public void onCreate(Bundle savedInstanceState)
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()
Expand Down Expand Up @@ -205,7 +204,9 @@ public void onAttach(Activity activity)


/**
* {@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
{
Expand Down

0 comments on commit ba27436

Please sign in to comment.