Android: Fix displaying the current value of double tap setting

This commit is contained in:
JosJuice 2022-04-05 18:58:29 +02:00
parent a4445fa1b0
commit cdff426d23
1 changed files with 12 additions and 1 deletions

View File

@ -870,7 +870,18 @@ public final class EmulationActivity extends AppCompatActivity
currentValue = InputOverlay.OVERLAY_WIIMOTE; currentValue = InputOverlay.OVERLAY_WIIMOTE;
} }
builder.setSingleChoiceItems(buttonList, currentValue, int checkedItem = -1;
int itemCount = getResources().getStringArray(buttonList).length;
for (int i = 0; i < itemCount; i++)
{
if (InputOverlayPointer.DOUBLE_TAP_OPTIONS.get(i) == currentValue)
{
checkedItem = i;
break;
}
}
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)));