Merge pull request #10562 from JosJuice/android-double-tap-get

Android: Fix displaying the current value of double tap setting
This commit is contained in:
Mai M 2022-04-08 20:50:12 -04:00 committed by GitHub
commit d4e4b56047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -879,13 +879,18 @@ public final class EmulationActivity extends AppCompatActivity
int buttonList = currentController == InputOverlay.OVERLAY_WIIMOTE_CLASSIC ? int buttonList = currentController == InputOverlay.OVERLAY_WIIMOTE_CLASSIC ?
R.array.doubleTapWithClassic : R.array.doubleTap; R.array.doubleTapWithClassic : R.array.doubleTap;
if (currentController != InputOverlay.OVERLAY_WIIMOTE_CLASSIC && int checkedItem = -1;
currentValue == InputOverlay.OVERLAY_WIIMOTE_CLASSIC) int itemCount = getResources().getStringArray(buttonList).length;
for (int i = 0; i < itemCount; i++)
{ {
currentValue = InputOverlay.OVERLAY_WIIMOTE; if (InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(i) == currentValue)
{
checkedItem = i;
break;
}
} }
builder.setSingleChoiceItems(buttonList, currentValue, builder.setSingleChoiceItems(buttonList, checkedItem,
(DialogInterface dialog, int which) -> IntSetting.MAIN_DOUBLE_TAP_BUTTON (DialogInterface dialog, int which) -> IntSetting.MAIN_DOUBLE_TAP_BUTTON
.setInt(mSettings, InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(which))); .setInt(mSettings, InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(which)));