Android: Hide controller mappings button when controller type is None
Also removed the make_sure_continuous_scan_enabled message. It doesn't make sense with the new UX.
This commit is contained in:
parent
b827b155a0
commit
96deb2d897
|
@ -310,6 +310,12 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
|
||||||
mPresenter.onMenuTagAction(menuTag, value);
|
mPresenter.onMenuTagAction(menuTag, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasMenuTagActionForValue(@NonNull MenuTag menuTag, int value)
|
||||||
|
{
|
||||||
|
return mPresenter.hasMenuTagActionForValue(menuTag, value);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSupportNavigateUp()
|
public boolean onSupportNavigateUp()
|
||||||
{
|
{
|
||||||
|
|
|
@ -153,21 +153,15 @@ public final class SettingsActivityPresenter
|
||||||
|
|
||||||
if (menuTag.isWiimoteMenu())
|
if (menuTag.isWiimoteMenu())
|
||||||
{
|
{
|
||||||
switch (value)
|
if (value == 1) // Emulated Wii Remote
|
||||||
{
|
{
|
||||||
case 1:
|
mView.showSettingsFragment(menuTag, null, true, mGameId);
|
||||||
mView.showSettingsFragment(menuTag, null, true, mGameId);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
mView.showToastMessage(mActivity.getString(R.string.make_sure_continuous_scan_enabled));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menuTag.isWiimoteExtensionMenu())
|
if (menuTag.isWiimoteExtensionMenu())
|
||||||
{
|
{
|
||||||
if (value != 0) // None
|
if (value != 0) // Not disabled
|
||||||
{
|
{
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putInt(SettingsFragmentPresenter.ARG_CONTROLLER_TYPE, value);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,11 +64,20 @@ public interface SettingsActivityView
|
||||||
* Called by a containing Fragment to tell the containing Activity that the user wants to open the
|
* Called by a containing Fragment to tell the containing Activity that the user wants to open the
|
||||||
* MenuTag associated with a setting.
|
* MenuTag associated with a setting.
|
||||||
*
|
*
|
||||||
* @param menuTag The MenuTag to open.
|
* @param menuTag The MenuTag of the setting.
|
||||||
* @param value The current value of the associated setting.
|
* @param value The current value of the setting.
|
||||||
*/
|
*/
|
||||||
void onMenuTagAction(@NonNull MenuTag menuTag, int value);
|
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
|
* Show loading dialog while loading the settings
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -472,6 +472,11 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
||||||
mView.onMenuTagAction(menuTag, value);
|
mView.onMenuTagAction(menuTag, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasMenuTagActionForValue(@NonNull MenuTag menuTag, int value)
|
||||||
|
{
|
||||||
|
return mView.hasMenuTagActionForValue(menuTag, value);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which)
|
public void onClick(DialogInterface dialog, int which)
|
||||||
{
|
{
|
||||||
|
|
|
@ -231,6 +231,11 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
|
||||||
mActivity.onMenuTagAction(menuTag, value);
|
mActivity.onMenuTagAction(menuTag, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasMenuTagActionForValue(@NonNull MenuTag menuTag, int value)
|
||||||
|
{
|
||||||
|
return mActivity.hasMenuTagActionForValue(menuTag, value);
|
||||||
|
}
|
||||||
|
|
||||||
private void setInsets()
|
private void setInsets()
|
||||||
{
|
{
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(mBinding.listSettings, (v, windowInsets) ->
|
ViewCompat.setOnApplyWindowInsetsListener(mBinding.listSettings, (v, windowInsets) ->
|
||||||
|
|
|
@ -76,8 +76,17 @@ public interface SettingsFragmentView
|
||||||
* Have the fragment tell the containing Activity that the user wants to open the MenuTag
|
* Have the fragment tell the containing Activity that the user wants to open the MenuTag
|
||||||
* associated with a setting.
|
* associated with a setting.
|
||||||
*
|
*
|
||||||
* @param menuTag The MenuTag to open.
|
* @param menuTag The MenuTag of the setting.
|
||||||
* @param value The current value of the associated setting.
|
* @param value The current value of the setting.
|
||||||
*/
|
*/
|
||||||
void onMenuTagAction(@NonNull MenuTag menuTag, int value);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,8 @@ public final class SingleChoiceViewHolder extends SettingViewHolder
|
||||||
getSelectedValue = setting::getSelectedValueIndex;
|
getSelectedValue = setting::getSelectedValueIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menuTag != null)
|
if (menuTag != null &&
|
||||||
|
adapter.hasMenuTagActionForValue(menuTag, getSelectedValue.apply(settings)))
|
||||||
{
|
{
|
||||||
mBinding.buttonMoreSettings.setVisibility(View.VISIBLE);
|
mBinding.buttonMoreSettings.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,13 @@
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:minHeight="72dp"
|
|
||||||
android:nextFocusLeft="@id/button_more_settings">
|
android:nextFocusLeft="@id/button_more_settings">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_setting_name"
|
android:id="@+id/text_setting_name"
|
||||||
style="@style/TextAppearance.MaterialComponents.Headline5"
|
style="@style/TextAppearance.MaterialComponents.Headline5"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_marginEnd="@dimen/spacing_large"
|
android:layout_marginEnd="@dimen/spacing_large"
|
||||||
|
@ -24,11 +22,12 @@
|
||||||
android:layout_marginTop="@dimen/spacing_large"
|
android:layout_marginTop="@dimen/spacing_large"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
|
android:layout_toStartOf="@+id/button_more_settings"
|
||||||
tools:text="Setting Name" />
|
tools:text="Setting Name" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_setting_description"
|
android:id="@+id/text_setting_description"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignStart="@+id/text_setting_name"
|
android:layout_alignStart="@+id/text_setting_name"
|
||||||
|
@ -37,6 +36,7 @@
|
||||||
android:layout_marginEnd="@dimen/spacing_large"
|
android:layout_marginEnd="@dimen/spacing_large"
|
||||||
android:layout_marginStart="@dimen/spacing_large"
|
android:layout_marginStart="@dimen/spacing_large"
|
||||||
android:layout_marginTop="@dimen/spacing_small"
|
android:layout_marginTop="@dimen/spacing_small"
|
||||||
|
android:layout_toStartOf="@+id/button_more_settings"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
tools:text="@string/overclock_enable_description" />
|
tools:text="@string/overclock_enable_description" />
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,13 @@
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:minHeight="72dp"
|
|
||||||
android:nextFocusRight="@id/button_more_settings">
|
android:nextFocusRight="@id/button_more_settings">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_setting_name"
|
android:id="@+id/text_setting_name"
|
||||||
style="@style/TextAppearance.MaterialComponents.Headline5"
|
style="@style/TextAppearance.MaterialComponents.Headline5"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_marginEnd="@dimen/spacing_large"
|
android:layout_marginEnd="@dimen/spacing_large"
|
||||||
|
@ -24,11 +22,12 @@
|
||||||
android:layout_marginTop="@dimen/spacing_large"
|
android:layout_marginTop="@dimen/spacing_large"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
|
android:layout_toStartOf="@+id/button_more_settings"
|
||||||
tools:text="Setting Name" />
|
tools:text="Setting Name" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_setting_description"
|
android:id="@+id/text_setting_description"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignStart="@+id/text_setting_name"
|
android:layout_alignStart="@+id/text_setting_name"
|
||||||
|
@ -37,6 +36,7 @@
|
||||||
android:layout_marginEnd="@dimen/spacing_large"
|
android:layout_marginEnd="@dimen/spacing_large"
|
||||||
android:layout_marginStart="@dimen/spacing_large"
|
android:layout_marginStart="@dimen/spacing_large"
|
||||||
android:layout_marginTop="@dimen/spacing_small"
|
android:layout_marginTop="@dimen/spacing_small"
|
||||||
|
android:layout_toStartOf="@+id/button_more_settings"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
tools:text="@string/overclock_enable_description" />
|
tools:text="@string/overclock_enable_description" />
|
||||||
|
|
||||||
|
|
|
@ -683,7 +683,6 @@ It can efficiently compress both junk data and encrypted Wii data.
|
||||||
<string name="replug_gc_adapter">GameCube Adapter couldn\'t be opened. Please re-plug the device.</string>
|
<string name="replug_gc_adapter">GameCube Adapter couldn\'t be opened. Please re-plug the device.</string>
|
||||||
<string name="disabled_gc_overlay_notice">GameCube Controller 1 is set to \"None\"</string>
|
<string name="disabled_gc_overlay_notice">GameCube Controller 1 is set to \"None\"</string>
|
||||||
<string name="ignore_warning_alert_messages">Ignore for this session</string>
|
<string name="ignore_warning_alert_messages">Ignore for this session</string>
|
||||||
<string name="make_sure_continuous_scan_enabled">Please make sure Continuous Scanning is enabled in Core Settings.</string>
|
|
||||||
|
|
||||||
<!-- UI CPU Core selection -->
|
<!-- UI CPU Core selection -->
|
||||||
<string name="jit_recompiler_x86">JIT Recompiler for x86–64 (recommended)</string>
|
<string name="jit_recompiler_x86">JIT Recompiler for x86–64 (recommended)</string>
|
||||||
|
|
Loading…
Reference in New Issue