mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
[Android] Make CoreSelection and HistorySelection statically instantiable.
Allows showing the dialogs without the need for an actual variable or ugly "new HistorySelection(fm, tag).show();" syntax. Also moved the else if for "Quit Retroarch" to the bottom of the if statements so its structured relative to the UI.
This commit is contained in:
parent
97cec15dcd
commit
95539090ec
@ -27,6 +27,16 @@ public final class CoreSelection extends DialogFragment
|
|||||||
{
|
{
|
||||||
private IconAdapter<ModuleWrapper> adapter;
|
private IconAdapter<ModuleWrapper> adapter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a statically instantiated instance of CoreSelection.
|
||||||
|
*
|
||||||
|
* @return a statically instantiated instance of CoreSelection.
|
||||||
|
*/
|
||||||
|
public static CoreSelection newInstance()
|
||||||
|
{
|
||||||
|
return new CoreSelection();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
|
@ -33,6 +33,16 @@ public final class HistorySelection extends DialogFragment
|
|||||||
private FragmentActivity ctx;
|
private FragmentActivity ctx;
|
||||||
private IconAdapter<HistoryWrapper> adapter;
|
private IconAdapter<HistoryWrapper> adapter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a statically instantiated instance of HistorySelection.
|
||||||
|
*
|
||||||
|
* @return a statically instantiated instance of HistorySelection.
|
||||||
|
*/
|
||||||
|
public static HistorySelection newInstance()
|
||||||
|
{
|
||||||
|
return new HistorySelection();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
|
@ -347,14 +347,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
|
|||||||
// Load Core Preference
|
// Load Core Preference
|
||||||
else if (prefKey.equals("loadCorePref"))
|
else if (prefKey.equals("loadCorePref"))
|
||||||
{
|
{
|
||||||
final CoreSelection coreSelection = new CoreSelection();
|
CoreSelection.newInstance().show(getFragmentManager(), "core_selection");
|
||||||
coreSelection.show(getFragmentManager(), "core_selection");
|
|
||||||
}
|
|
||||||
// Quit RetroArch preference
|
|
||||||
else if (prefKey.equals("quitRetroArch"))
|
|
||||||
{
|
|
||||||
// TODO - needs to close entire app gracefully - including
|
|
||||||
// NativeActivity if possible
|
|
||||||
}
|
}
|
||||||
// Load ROM Preference
|
// Load ROM Preference
|
||||||
else if (prefKey.equals("loadRomPref"))
|
else if (prefKey.equals("loadRomPref"))
|
||||||
@ -382,8 +375,13 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
|
|||||||
// Load ROM (History) Preference
|
// Load ROM (History) Preference
|
||||||
else if (prefKey.equals("loadRomHistoryPref"))
|
else if (prefKey.equals("loadRomHistoryPref"))
|
||||||
{
|
{
|
||||||
final HistorySelection historySelection = new HistorySelection();
|
HistorySelection.newInstance().show(getFragmentManager(), "history_selection");
|
||||||
historySelection.show(getFragmentManager(), "history_selection");
|
}
|
||||||
|
// Quit RetroArch preference
|
||||||
|
else if (prefKey.equals("quitRetroArch"))
|
||||||
|
{
|
||||||
|
// TODO - needs to close entire app gracefully - including
|
||||||
|
// NativeActivity if possible
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user