Merge pull request #9357 from JosJuice/android-one-settings-entrypoint
Android: Only have one settings entrypoint per activity/dialog
|
@ -99,7 +99,7 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
MENU_ACTION_LOAD_SLOT6, MENU_ACTION_EXIT, MENU_ACTION_CHANGE_DISC,
|
MENU_ACTION_LOAD_SLOT6, MENU_ACTION_EXIT, MENU_ACTION_CHANGE_DISC,
|
||||||
MENU_ACTION_RESET_OVERLAY, MENU_SET_IR_SENSITIVITY, MENU_ACTION_CHOOSE_DOUBLETAP,
|
MENU_ACTION_RESET_OVERLAY, MENU_SET_IR_SENSITIVITY, MENU_ACTION_CHOOSE_DOUBLETAP,
|
||||||
MENU_ACTION_MOTION_CONTROLS, MENU_ACTION_PAUSE_EMULATION, MENU_ACTION_UNPAUSE_EMULATION,
|
MENU_ACTION_MOTION_CONTROLS, MENU_ACTION_PAUSE_EMULATION, MENU_ACTION_UNPAUSE_EMULATION,
|
||||||
MENU_ACTION_OVERLAY_CONTROLS, MENU_ACTION_SETTINGS_CORE, MENU_ACTION_SETTINGS_GRAPHICS})
|
MENU_ACTION_OVERLAY_CONTROLS, MENU_ACTION_SETTINGS})
|
||||||
public @interface MenuAction
|
public @interface MenuAction
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -137,8 +137,7 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
public static final int MENU_ACTION_PAUSE_EMULATION = 30;
|
public static final int MENU_ACTION_PAUSE_EMULATION = 30;
|
||||||
public static final int MENU_ACTION_UNPAUSE_EMULATION = 31;
|
public static final int MENU_ACTION_UNPAUSE_EMULATION = 31;
|
||||||
public static final int MENU_ACTION_OVERLAY_CONTROLS = 32;
|
public static final int MENU_ACTION_OVERLAY_CONTROLS = 32;
|
||||||
public static final int MENU_ACTION_SETTINGS_CORE = 33;
|
public static final int MENU_ACTION_SETTINGS = 33;
|
||||||
public static final int MENU_ACTION_SETTINGS_GRAPHICS = 34;
|
|
||||||
|
|
||||||
private static final SparseIntArray buttonsActionsMap = new SparseIntArray();
|
private static final SparseIntArray buttonsActionsMap = new SparseIntArray();
|
||||||
|
|
||||||
|
@ -656,12 +655,8 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
showMotionControlsOptions();
|
showMotionControlsOptions();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ACTION_SETTINGS_CORE:
|
case MENU_ACTION_SETTINGS:
|
||||||
SettingsActivity.launch(this, MenuTag.CONFIG);
|
SettingsActivity.launch(this, MenuTag.SETTINGS);
|
||||||
break;
|
|
||||||
|
|
||||||
case MENU_ACTION_SETTINGS_GRAPHICS:
|
|
||||||
SettingsActivity.launch(this, MenuTag.GRAPHICS);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ACTION_EXIT:
|
case MENU_ACTION_EXIT:
|
||||||
|
|
|
@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
|
||||||
|
|
||||||
public enum MenuTag
|
public enum MenuTag
|
||||||
{
|
{
|
||||||
|
SETTINGS("settings"),
|
||||||
CONFIG("config"),
|
CONFIG("config"),
|
||||||
CONFIG_GENERAL("config_general"),
|
CONFIG_GENERAL("config_general"),
|
||||||
CONFIG_INTERFACE("config_interface"),
|
CONFIG_INTERFACE("config_interface"),
|
||||||
|
|
|
@ -35,7 +35,8 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
titles.put(MenuTag.CONFIG, R.string.preferences_settings);
|
titles.put(MenuTag.SETTINGS, R.string.preferences_settings);
|
||||||
|
titles.put(MenuTag.CONFIG, R.string.config);
|
||||||
titles.put(MenuTag.CONFIG_GENERAL, R.string.general_submenu);
|
titles.put(MenuTag.CONFIG_GENERAL, R.string.general_submenu);
|
||||||
titles.put(MenuTag.CONFIG_INTERFACE, R.string.interface_submenu);
|
titles.put(MenuTag.CONFIG_INTERFACE, R.string.interface_submenu);
|
||||||
titles.put(MenuTag.CONFIG_AUDIO, R.string.audio_submenu);
|
titles.put(MenuTag.CONFIG_AUDIO, R.string.audio_submenu);
|
||||||
|
@ -43,10 +44,10 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
|
||||||
titles.put(MenuTag.CONFIG_GAME_CUBE, R.string.gamecube_submenu);
|
titles.put(MenuTag.CONFIG_GAME_CUBE, R.string.gamecube_submenu);
|
||||||
titles.put(MenuTag.CONFIG_WII, R.string.wii_submenu);
|
titles.put(MenuTag.CONFIG_WII, R.string.wii_submenu);
|
||||||
titles.put(MenuTag.CONFIG_ADVANCED, R.string.advanced_submenu);
|
titles.put(MenuTag.CONFIG_ADVANCED, R.string.advanced_submenu);
|
||||||
titles.put(MenuTag.WIIMOTE, R.string.grid_menu_wiimote_settings);
|
titles.put(MenuTag.WIIMOTE, R.string.wiimote_settings);
|
||||||
titles.put(MenuTag.WIIMOTE_EXTENSION, R.string.wiimote_extensions);
|
titles.put(MenuTag.WIIMOTE_EXTENSION, R.string.wiimote_extensions);
|
||||||
titles.put(MenuTag.GCPAD_TYPE, R.string.grid_menu_gcpad_settings);
|
titles.put(MenuTag.GCPAD_TYPE, R.string.gcpad_settings);
|
||||||
titles.put(MenuTag.GRAPHICS, R.string.grid_menu_graphics_settings);
|
titles.put(MenuTag.GRAPHICS, R.string.graphics_settings);
|
||||||
titles.put(MenuTag.HACKS, R.string.hacks_submenu);
|
titles.put(MenuTag.HACKS, R.string.hacks_submenu);
|
||||||
titles.put(MenuTag.CONFIG_LOG, R.string.log_submenu);
|
titles.put(MenuTag.CONFIG_LOG, R.string.log_submenu);
|
||||||
titles.put(MenuTag.DEBUG, R.string.debug_submenu);
|
titles.put(MenuTag.DEBUG, R.string.debug_submenu);
|
||||||
|
|
|
@ -122,6 +122,10 @@ public final class SettingsFragmentPresenter
|
||||||
|
|
||||||
switch (mMenuTag)
|
switch (mMenuTag)
|
||||||
{
|
{
|
||||||
|
case SETTINGS:
|
||||||
|
addTopLevelSettings(sl);
|
||||||
|
break;
|
||||||
|
|
||||||
case CONFIG:
|
case CONFIG:
|
||||||
addConfigSettings(sl);
|
addConfigSettings(sl);
|
||||||
break;
|
break;
|
||||||
|
@ -216,6 +220,20 @@ public final class SettingsFragmentPresenter
|
||||||
mView.showSettingsList(mSettingsList);
|
mView.showSettingsList(mSettingsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addTopLevelSettings(ArrayList<SettingsItem> sl)
|
||||||
|
{
|
||||||
|
sl.add(new SubmenuSetting(R.string.config, MenuTag.CONFIG));
|
||||||
|
sl.add(new SubmenuSetting(R.string.graphics_settings, MenuTag.GRAPHICS));
|
||||||
|
|
||||||
|
if (!NativeLibrary.IsRunning())
|
||||||
|
{
|
||||||
|
sl.add(new SubmenuSetting(R.string.gcpad_settings, MenuTag.GCPAD_TYPE));
|
||||||
|
sl.add(new SubmenuSetting(R.string.wiimote_settings, MenuTag.WIIMOTE));
|
||||||
|
}
|
||||||
|
|
||||||
|
sl.add(new HeaderSetting(R.string.setting_clear_info, 0));
|
||||||
|
}
|
||||||
|
|
||||||
private void addConfigSettings(ArrayList<SettingsItem> sl)
|
private void addConfigSettings(ArrayList<SettingsItem> sl)
|
||||||
{
|
{
|
||||||
sl.add(new SubmenuSetting(R.string.general_submenu, MenuTag.CONFIG_GENERAL));
|
sl.add(new SubmenuSetting(R.string.general_submenu, MenuTag.CONFIG_GENERAL));
|
||||||
|
@ -227,7 +245,6 @@ public final class SettingsFragmentPresenter
|
||||||
sl.add(new SubmenuSetting(R.string.advanced_submenu, MenuTag.CONFIG_ADVANCED));
|
sl.add(new SubmenuSetting(R.string.advanced_submenu, MenuTag.CONFIG_ADVANCED));
|
||||||
sl.add(new SubmenuSetting(R.string.log_submenu, MenuTag.CONFIG_LOG));
|
sl.add(new SubmenuSetting(R.string.log_submenu, MenuTag.CONFIG_LOG));
|
||||||
sl.add(new SubmenuSetting(R.string.debug_submenu, MenuTag.DEBUG));
|
sl.add(new SubmenuSetting(R.string.debug_submenu, MenuTag.DEBUG));
|
||||||
sl.add(new HeaderSetting(R.string.setting_clear_info, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addGeneralSettings(ArrayList<SettingsItem> sl)
|
private void addGeneralSettings(ArrayList<SettingsItem> sl)
|
||||||
|
@ -513,7 +530,6 @@ public final class SettingsFragmentPresenter
|
||||||
sl.add(new HeaderSetting(R.string.graphics_enhancements_and_hacks, 0));
|
sl.add(new HeaderSetting(R.string.graphics_enhancements_and_hacks, 0));
|
||||||
sl.add(new SubmenuSetting(R.string.enhancements_submenu, MenuTag.ENHANCEMENTS));
|
sl.add(new SubmenuSetting(R.string.enhancements_submenu, MenuTag.ENHANCEMENTS));
|
||||||
sl.add(new SubmenuSetting(R.string.hacks_submenu, MenuTag.HACKS));
|
sl.add(new SubmenuSetting(R.string.hacks_submenu, MenuTag.HACKS));
|
||||||
sl.add(new HeaderSetting(R.string.setting_clear_info, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addEnhanceSettings(ArrayList<SettingsItem> sl)
|
private void addEnhanceSettings(ArrayList<SettingsItem> sl)
|
||||||
|
|
|
@ -48,9 +48,7 @@ public final class MenuFragment extends Fragment implements View.OnClickListener
|
||||||
.append(R.id.menu_refresh_wiimotes, EmulationActivity.MENU_ACTION_REFRESH_WIIMOTES);
|
.append(R.id.menu_refresh_wiimotes, EmulationActivity.MENU_ACTION_REFRESH_WIIMOTES);
|
||||||
buttonsActionsMap.append(R.id.menu_change_disc, EmulationActivity.MENU_ACTION_CHANGE_DISC);
|
buttonsActionsMap.append(R.id.menu_change_disc, EmulationActivity.MENU_ACTION_CHANGE_DISC);
|
||||||
buttonsActionsMap.append(R.id.menu_exit, EmulationActivity.MENU_ACTION_EXIT);
|
buttonsActionsMap.append(R.id.menu_exit, EmulationActivity.MENU_ACTION_EXIT);
|
||||||
buttonsActionsMap.append(R.id.menu_settings_core, EmulationActivity.MENU_ACTION_SETTINGS_CORE);
|
buttonsActionsMap.append(R.id.menu_settings, EmulationActivity.MENU_ACTION_SETTINGS);
|
||||||
buttonsActionsMap.append(R.id.menu_settings_graphics,
|
|
||||||
EmulationActivity.MENU_ACTION_SETTINGS_GRAPHICS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MenuFragment newInstance()
|
public static MenuFragment newInstance()
|
||||||
|
|
|
@ -71,20 +71,8 @@ public final class MainPresenter
|
||||||
{
|
{
|
||||||
switch (itemId)
|
switch (itemId)
|
||||||
{
|
{
|
||||||
case R.id.menu_settings_core:
|
case R.id.menu_settings:
|
||||||
mView.launchSettingsActivity(MenuTag.CONFIG);
|
mView.launchSettingsActivity(MenuTag.SETTINGS);
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.menu_settings_graphics:
|
|
||||||
mView.launchSettingsActivity(MenuTag.GRAPHICS);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.menu_settings_gcpad:
|
|
||||||
mView.launchSettingsActivity(MenuTag.GCPAD_TYPE);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.menu_settings_wiimote:
|
|
||||||
mView.launchSettingsActivity(MenuTag.WIIMOTE);
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.menu_refresh:
|
case R.id.menu_refresh:
|
||||||
|
|
|
@ -313,21 +313,9 @@ public final class TvMainActivity extends FragmentActivity implements MainView
|
||||||
{
|
{
|
||||||
ArrayObjectAdapter rowItems = new ArrayObjectAdapter(new SettingsRowPresenter());
|
ArrayObjectAdapter rowItems = new ArrayObjectAdapter(new SettingsRowPresenter());
|
||||||
|
|
||||||
rowItems.add(new TvSettingsItem(R.id.menu_settings_core,
|
rowItems.add(new TvSettingsItem(R.id.menu_settings,
|
||||||
R.drawable.ic_settings_core_tv,
|
R.drawable.ic_settings_tv,
|
||||||
R.string.grid_menu_config));
|
R.string.grid_menu_settings));
|
||||||
|
|
||||||
rowItems.add(new TvSettingsItem(R.id.menu_settings_graphics,
|
|
||||||
R.drawable.ic_settings_graphics_tv,
|
|
||||||
R.string.grid_menu_graphics_settings));
|
|
||||||
|
|
||||||
rowItems.add(new TvSettingsItem(R.id.menu_settings_gcpad,
|
|
||||||
R.drawable.ic_settings_gcpad,
|
|
||||||
R.string.grid_menu_gcpad_settings));
|
|
||||||
|
|
||||||
rowItems.add(new TvSettingsItem(R.id.menu_settings_wiimote,
|
|
||||||
R.drawable.ic_settings_wiimote,
|
|
||||||
R.string.grid_menu_wiimote_settings));
|
|
||||||
|
|
||||||
rowItems.add(new TvSettingsItem(R.id.button_add_directory,
|
rowItems.add(new TvSettingsItem(R.id.button_add_directory,
|
||||||
R.drawable.ic_add_tv,
|
R.drawable.ic_add_tv,
|
||||||
|
|
After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 266 B |
Before Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 140 B |
Before Width: | Height: | Size: 264 B |
After Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 300 B |
Before Width: | Height: | Size: 451 B |
After Width: | Height: | Size: 788 B |
Before Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 288 B |
Before Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 569 B |
Before Width: | Height: | Size: 862 B |
Before Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 569 B |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 862 B |
|
@ -31,16 +31,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/menu_settings_core"
|
|
||||||
android:text="@string/grid_menu_config"
|
|
||||||
style="@style/InGameMenuOption"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/menu_settings_graphics"
|
|
||||||
android:text="@string/grid_menu_graphics_settings"
|
|
||||||
style="@style/InGameMenuOption"/>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/menu_pause_emulation"
|
android:id="@+id/menu_pause_emulation"
|
||||||
android:text="@string/pause_emulation"
|
android:text="@string/pause_emulation"
|
||||||
|
@ -81,6 +71,11 @@
|
||||||
style="@style/InGameMenuOption"
|
style="@style/InGameMenuOption"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/menu_settings"
|
||||||
|
android:text="@string/grid_menu_settings"
|
||||||
|
style="@style/InGameMenuOption"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/menu_overlay_controls"
|
android:id="@+id/menu_overlay_controls"
|
||||||
android:text="@string/emulation_overlay_controls"
|
android:text="@string/emulation_overlay_controls"
|
||||||
|
|
|
@ -3,27 +3,9 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_settings_core"
|
android:id="@+id/menu_settings"
|
||||||
android:title="@string/grid_menu_config"
|
android:title="@string/grid_menu_settings"
|
||||||
android:icon="@drawable/ic_settings_core"
|
android:icon="@drawable/ic_settings"
|
||||||
app:showAsAction="ifRoom"/>
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/menu_settings_graphics"
|
|
||||||
android:title="@string/grid_menu_graphics_settings"
|
|
||||||
android:icon="@drawable/ic_settings_graphics"
|
|
||||||
app:showAsAction="ifRoom"/>
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/menu_settings_gcpad"
|
|
||||||
android:title="@string/grid_menu_gcpad_settings"
|
|
||||||
android:icon="@drawable/ic_settings_gcpad"
|
|
||||||
app:showAsAction="ifRoom"/>
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/menu_settings_wiimote"
|
|
||||||
android:title="@string/grid_menu_wiimote_settings"
|
|
||||||
android:icon="@drawable/ic_settings_wiimote"
|
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="ifRoom"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
|
|
|
@ -121,6 +121,12 @@
|
||||||
<string name="turntable_effect_dial">Dial</string>
|
<string name="turntable_effect_dial">Dial</string>
|
||||||
<string name="turntable_crossfade">Crossfade</string>
|
<string name="turntable_crossfade">Crossfade</string>
|
||||||
|
|
||||||
|
<!-- Main Preference Fragment -->
|
||||||
|
<string name="config">Config</string>
|
||||||
|
<string name="graphics_settings">Graphics Settings</string>
|
||||||
|
<string name="gcpad_settings">GameCube Input</string>
|
||||||
|
<string name="wiimote_settings">Wii Input</string>
|
||||||
|
|
||||||
<!-- General Preference Fragment -->
|
<!-- General Preference Fragment -->
|
||||||
<string name="general_submenu">General</string>
|
<string name="general_submenu">General</string>
|
||||||
<string name="dual_core">Dual Core</string>
|
<string name="dual_core">Dual Core</string>
|
||||||
|
@ -319,10 +325,7 @@
|
||||||
|
|
||||||
<!-- Game Grid Screen-->
|
<!-- Game Grid Screen-->
|
||||||
<string name="add_directory_title">Add Folder to Library</string>
|
<string name="add_directory_title">Add Folder to Library</string>
|
||||||
<string name="grid_menu_config">Config</string>
|
<string name="grid_menu_settings">Settings</string>
|
||||||
<string name="grid_menu_graphics_settings">Graphics Settings</string>
|
|
||||||
<string name="grid_menu_gcpad_settings">GameCube Input</string>
|
|
||||||
<string name="grid_menu_wiimote_settings">Wii Input</string>
|
|
||||||
<string name="grid_menu_refresh">Refresh Library</string>
|
<string name="grid_menu_refresh">Refresh Library</string>
|
||||||
<string name="grid_menu_open_file">Open File</string>
|
<string name="grid_menu_open_file">Open File</string>
|
||||||
<string name="grid_menu_install_wad">Install WAD</string>
|
<string name="grid_menu_install_wad">Install WAD</string>
|
||||||
|
|