Skip to content

Commit

Permalink
Merge pull request #9068 from Ebola16/Fixes5
Browse files Browse the repository at this point in the history
Android: Minor cleanup
  • Loading branch information
lioncash committed Sep 8, 2020
2 parents 3d33b1c + 1aacb57 commit 365e812
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 23 deletions.
Expand Up @@ -857,17 +857,16 @@ else if (mPreferences.getInt("wiiController", 3) == 4)
.putBoolean("buttonToggleWii" + indexSelected, isChecked));
}
}
builder.setNeutralButton(getString(R.string.emulation_toggle_all),
builder.setNeutralButton(R.string.emulation_toggle_all,
(dialogInterface, i) -> mEmulationFragment.toggleInputOverlayVisibility());
builder.setPositiveButton(getString(R.string.ok), (dialogInterface, i) ->
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
editor.apply();

mEmulationFragment.refreshInputOverlay();
});

AlertDialog alertDialog = builder.create();
alertDialog.show();
builder.show();
}

public void chooseDoubleTapButton()
Expand All @@ -893,14 +892,13 @@ public void chooseDoubleTapButton()
builder.setSingleChoiceItems(buttonList, currentValue, (DialogInterface dialog, int which) ->
editor.putInt("doubleTapButton", InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(which)));

builder.setPositiveButton(getString(R.string.ok), (dialogInterface, i) ->
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
editor.commit();
mEmulationFragment.initInputPointer();
});

AlertDialog alertDialog = builder.create();
alertDialog.show();
builder.show();
}

private void adjustScale()
Expand Down Expand Up @@ -938,7 +936,7 @@ public void onStopTrackingTouch(SeekBar seekBar)
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.DolphinDialogBase);
builder.setTitle(R.string.emulation_control_scale);
builder.setView(view);
builder.setPositiveButton(getString(R.string.ok), (dialogInterface, i) ->
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
SharedPreferences.Editor editor = mPreferences.edit();
editor.putInt("controlScale", seekbar.getProgress());
Expand All @@ -947,8 +945,7 @@ public void onStopTrackingTouch(SeekBar seekBar)
mEmulationFragment.refreshInputOverlay();
});

AlertDialog alertDialog = builder.create();
alertDialog.show();
builder.show();
}

private void chooseController()
Expand All @@ -971,14 +968,13 @@ private void chooseController()

NativeLibrary.ReloadWiimoteConfig();
});
builder.setPositiveButton(getString(R.string.ok), (dialogInterface, i) ->
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
editor.apply();
mEmulationFragment.refreshInputOverlay();
});

AlertDialog alertDialog = builder.create();
alertDialog.show();
builder.show();
}

private void showMotionControlsOptions()
Expand All @@ -1004,10 +1000,9 @@ private void showMotionControlsOptions()

NativeLibrary.ReloadWiimoteConfig();
});
builder.setPositiveButton(getString(R.string.ok), (dialogInterface, i) -> editor.apply());
builder.setPositiveButton(R.string.ok, (dialogInterface, i) -> editor.apply());

AlertDialog alertDialog = builder.create();
alertDialog.show();
builder.show();
}

private void chooseOrientation()
Expand All @@ -1031,14 +1026,13 @@ private void chooseOrientation()
int orientation = orientationValues[indexSelected];
editor.putInt("emulationActivityOrientation", orientation);
});
builder.setPositiveButton(getString(R.string.ok), (dialogInterface, i) ->
builder.setPositiveButton(R.string.ok, (dialogInterface, i) ->
{
editor.apply();
updateOrientation();
});

AlertDialog alertDialog = builder.create();
alertDialog.show();
builder.show();
}

private void setIRSensitivity()
Expand Down Expand Up @@ -1180,7 +1174,6 @@ private void resetOverlay()
.setNegativeButton(R.string.cancel, (dialogInterface, i) ->
{
})
.create()
.show();
}

Expand Down
Expand Up @@ -186,7 +186,6 @@ public void showGameIniJunkDeletionQuestion()
.setMessage(getString(R.string.game_ini_junk_question))
.setPositiveButton(R.string.yes, (dialogInterface, i) -> mPresenter.clearSettings())
.setNegativeButton(R.string.no, null)
.create()
.show();
}

Expand Down
Expand Up @@ -59,7 +59,6 @@ private static void showMessage(Context context, SharedPreferences preferences)
sPrefsEditor.apply();
SettingsFile.firstAnalyticsAdd(false);
})
.create()
.show();
}

Expand Down
Expand Up @@ -68,7 +68,6 @@ private static void showMessageOKCancel(final FragmentActivity activity, String
.setNegativeButton(android.R.string.cancel, (dialogInterface, i) ->
Toast.makeText(activity, R.string.write_permission_needed, Toast.LENGTH_SHORT)
.show())
.create()
.show();
}
}

0 comments on commit 365e812

Please sign in to comment.