diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java index 99ec999f39..2af17e2d2f 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java @@ -310,6 +310,12 @@ public final class SettingsActivity extends AppCompatActivity implements Setting mPresenter.onMenuTagAction(menuTag, value); } + @Override + public boolean hasMenuTagActionForValue(@NonNull MenuTag menuTag, int value) + { + return mPresenter.hasMenuTagActionForValue(menuTag, value); + } + @Override public boolean onSupportNavigateUp() { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityPresenter.java index 8bc2e2141f..cc235b9863 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityPresenter.java @@ -153,21 +153,15 @@ public final class SettingsActivityPresenter if (menuTag.isWiimoteMenu()) { - switch (value) + if (value == 1) // Emulated Wii Remote { - case 1: - mView.showSettingsFragment(menuTag, null, true, mGameId); - break; - - case 2: - mView.showToastMessage(mActivity.getString(R.string.make_sure_continuous_scan_enabled)); - break; + mView.showSettingsFragment(menuTag, null, true, mGameId); } } if (menuTag.isWiimoteExtensionMenu()) { - if (value != 0) // None + if (value != 0) // Not disabled { Bundle bundle = new Bundle(); bundle.putInt(SettingsFragmentPresenter.ARG_CONTROLLER_TYPE, value); @@ -175,4 +169,29 @@ public final class SettingsActivityPresenter } } } + + public boolean hasMenuTagActionForValue(@NonNull MenuTag menuTag, int value) + { + if (menuTag.isSerialPort1Menu()) + { + return (value != 0 && value != 255); // Not disabled or dummy + } + + if (menuTag.isGCPadMenu()) + { + return (value != 0); // Not disabled + } + + if (menuTag.isWiimoteMenu()) + { + return (value == 1); // Emulated Wii Remote + } + + if (menuTag.isWiimoteExtensionMenu()) + { + return (value != 0); // Not disabled + } + + return false; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.java index cb0c23f7be..c835aa4399 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.java @@ -64,11 +64,20 @@ public interface SettingsActivityView * Called by a containing Fragment to tell the containing Activity that the user wants to open the * MenuTag associated with a setting. * - * @param menuTag The MenuTag to open. - * @param value The current value of the associated setting. + * @param menuTag The MenuTag of the setting. + * @param value The current value of the setting. */ void onMenuTagAction(@NonNull MenuTag menuTag, int value); + /** + * Returns whether anything will happen when the user wants to open the MenuTag associated with a + * setting, given the current value of the setting. + * + * @param menuTag The MenuTag of the setting. + * @param value The current value of the setting. + */ + boolean hasMenuTagActionForValue(@NonNull MenuTag menuTag, int value); + /** * Show loading dialog while loading the settings */ diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java index cc9bf8f85e..a7f028afe3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java @@ -472,6 +472,11 @@ public final class SettingsAdapter extends RecyclerView.Adapter diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java index 7deeead9d2..295ff95abd 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java @@ -76,8 +76,17 @@ public interface SettingsFragmentView * Have the fragment tell the containing Activity that the user wants to open the MenuTag * associated with a setting. * - * @param menuTag The MenuTag to open. - * @param value The current value of the associated setting. + * @param menuTag The MenuTag of the setting. + * @param value The current value of the setting. */ void onMenuTagAction(@NonNull MenuTag menuTag, int value); + + /** + * Returns whether anything will happen when the user wants to open the MenuTag associated with a + * setting, given the current value of the setting. + * + * @param menuTag The MenuTag of the setting. + * @param value The current value of the setting. + */ + boolean hasMenuTagActionForValue(@NonNull MenuTag menuTag, int value); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java index 462ed4bb53..db56ebea40 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java @@ -101,7 +101,8 @@ public final class SingleChoiceViewHolder extends SettingViewHolder getSelectedValue = setting::getSelectedValueIndex; } - if (menuTag != null) + if (menuTag != null && + adapter.hasMenuTagActionForValue(menuTag, getSelectedValue.apply(settings))) { mBinding.buttonMoreSettings.setVisibility(View.VISIBLE); diff --git a/Source/Android/app/src/main/res/layout-ldrtl/list_item_setting.xml b/Source/Android/app/src/main/res/layout-ldrtl/list_item_setting.xml index 8e923c4bd8..eb2ac6c617 100644 --- a/Source/Android/app/src/main/res/layout-ldrtl/list_item_setting.xml +++ b/Source/Android/app/src/main/res/layout-ldrtl/list_item_setting.xml @@ -8,15 +8,13 @@ android:background="?android:attr/selectableItemBackground" android:clickable="true" android:focusable="true" - android:minHeight="72dp" android:nextFocusLeft="@id/button_more_settings"> diff --git a/Source/Android/app/src/main/res/layout/list_item_setting.xml b/Source/Android/app/src/main/res/layout/list_item_setting.xml index 93c4f2d6d3..e0bae52bef 100644 --- a/Source/Android/app/src/main/res/layout/list_item_setting.xml +++ b/Source/Android/app/src/main/res/layout/list_item_setting.xml @@ -8,15 +8,13 @@ android:background="?android:attr/selectableItemBackground" android:clickable="true" android:focusable="true" - android:minHeight="72dp" android:nextFocusRight="@id/button_more_settings"> diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index a89032e7e6..e81092cbb9 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -683,7 +683,6 @@ It can efficiently compress both junk data and encrypted Wii data. GameCube Adapter couldn\'t be opened. Please re-plug the device. GameCube Controller 1 is set to \"None\" Ignore for this session - Please make sure Continuous Scanning is enabled in Core Settings. JIT Recompiler for x86–64 (recommended)