Android: Add a function to remove all settings
This will remove all emulator settings, but will retain the folder configuration (BIOS / games) and any controller or OSD settings beyond the button theme.
This commit is contained in:
parent
2b77320460
commit
df1aee121f
|
@ -324,10 +324,8 @@ public class OptionsFragment extends Fragment {
|
|||
|
||||
// String[] regions = ArrayUtils.remove(parentActivity.getResources()
|
||||
// .getStringArray(R.array.region), 4);
|
||||
String[] regions = getResources()
|
||||
.getStringArray(R.array.region);
|
||||
Spinner region_spnr = (Spinner) getView().findViewById(
|
||||
R.id.region_spinner);
|
||||
String[] regions = getResources().getStringArray(R.array.region);
|
||||
Spinner region_spnr = (Spinner) getView().findViewById(R.id.region_spinner);
|
||||
ArrayAdapter<String> regionAdapter = new ArrayAdapter<String>(
|
||||
getActivity(), R.layout.spinner_selected, regions);
|
||||
regionAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
@ -687,6 +685,30 @@ public class OptionsFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
private void resetConfig() {
|
||||
mPrefs.edit().remove(Emulator.pref_usereios).apply();
|
||||
mPrefs.edit().remove(Config.pref_gamedetails).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_nativeact).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_dynarecopt).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_unstable).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_cable).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_dcregion).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_broadcast).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_limitfps).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_mipmaps).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_widescreen).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_frameskip).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_pvrrender).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_syncedrender).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_modvols).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_cheatdisk).apply();
|
||||
mPrefs.edit().remove(Config.pref_showfps).apply();
|
||||
mPrefs.edit().remove(Config.pref_rendertype).apply();
|
||||
mPrefs.edit().remove(Emulator.pref_nosound).apply();
|
||||
mPrefs.edit().remove(Config.pref_renderdepth).apply();
|
||||
mPrefs.edit().remove(Config.pref_theme).apply();
|
||||
}
|
||||
|
||||
private void showToastMessage(String message, int duration) {
|
||||
ConstraintLayout layout = (ConstraintLayout) getActivity().findViewById(R.id.mainui_layout);
|
||||
Snackbar snackbar = Snackbar.make(layout, message, duration);
|
||||
|
|
Loading…
Reference in New Issue