mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-26 02:30:30 +00:00
Improve Android keypad joystick selection routine
- Changes Skip button to not set anything - Adds a None button to explicitly choose that - Will dismiss selection routine instead of looping
This commit is contained in:
parent
399617e77f
commit
2bf379aad4
@ -84,14 +84,22 @@ public class Apple2KeypadChooser implements Apple2MenuView {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
calibrationContinue();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void calibrationContinue() {
|
||||||
final Handler handler = new Handler();
|
final Handler handler = new Handler();
|
||||||
handler.postDelayed(new Runnable() {
|
handler.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mChooserState = mChooserState.next();
|
mChooserState = mChooserState.next();
|
||||||
mCurrentChoicePrompt.setText(getNextChoiceString());
|
if (mChooserState.ordinal() == 0) {
|
||||||
Apple2Preferences.setJSONPref(Apple2SettingsMenu.SETTINGS.CURRENT_INPUT, Apple2SettingsMenu.TouchDeviceVariant.KEYBOARD.ordinal());
|
dismiss();
|
||||||
Apple2Preferences.sync(mActivity, Apple2Preferences.PREF_DOMAIN_TOUCHSCREEN);
|
} else {
|
||||||
|
mCurrentChoicePrompt.setText(getNextChoiceString());
|
||||||
|
Apple2Preferences.setJSONPref(Apple2SettingsMenu.SETTINGS.CURRENT_INPUT, Apple2SettingsMenu.TouchDeviceVariant.KEYBOARD.ordinal());
|
||||||
|
Apple2Preferences.sync(mActivity, Apple2Preferences.PREF_DOMAIN_TOUCHSCREEN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
@ -149,7 +157,17 @@ public class Apple2KeypadChooser implements Apple2MenuView {
|
|||||||
skipButton.setOnClickListener(new View.OnClickListener() {
|
skipButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Apple2KeypadChooser.this.onKeyTapCalibrationEvent((char) Apple2KeyboardSettingsMenu.ICONTEXT_NONACTION, -1);
|
Apple2Preferences.setJSONPref(Apple2SettingsMenu.SETTINGS.CURRENT_INPUT, Apple2SettingsMenu.TouchDeviceVariant.JOYSTICK_KEYPAD.ordinal());
|
||||||
|
Apple2Preferences.sync(mActivity, Apple2Preferences.PREF_DOMAIN_TOUCHSCREEN);
|
||||||
|
calibrationContinue();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Button noneButton = (Button) mSettingsView.findViewById(R.id.noneButton);
|
||||||
|
noneButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
onKeyTapCalibrationEvent((char) Apple2KeyboardSettingsMenu.ICONTEXT_NONACTION, -1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,11 +20,26 @@
|
|||||||
android:layout_marginLeft="@dimen/preference_margin_left"
|
android:layout_marginLeft="@dimen/preference_margin_left"
|
||||||
android:layout_marginStart="@dimen/preference_margin_left"
|
android:layout_marginStart="@dimen/preference_margin_left"
|
||||||
android:layout_marginTop="@dimen/preference_margin_top"
|
android:layout_marginTop="@dimen/preference_margin_top"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:textColor="@color/black"
|
||||||
android:text="@string/keypad_choose_current" />
|
android:text="@string/keypad_choose_current" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/noneButton"
|
||||||
|
style="?android:attr/buttonStyleSmall"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginEnd="@dimen/preference_margin_right"
|
||||||
|
android:layout_marginRight="@dimen/preference_margin_right"
|
||||||
|
android:layout_marginTop="@dimen/preference_margin_top"
|
||||||
|
android:text="@string/key_none" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/skipButton"
|
android:id="@+id/skipButton"
|
||||||
style="?android:attr/buttonStyleSmall"
|
style="?android:attr/buttonStyleSmall"
|
||||||
|
android:layout_below="@id/noneButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user