mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-14 18:30:01 +00:00
Let chooser interface handle skipping rather than native
This commit is contained in:
parent
104c0bbe6e
commit
c8d7f9cba3
@ -17,6 +17,7 @@ import android.util.Log;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -62,7 +63,7 @@ public class Apple2KeypadChooser implements Apple2MenuView {
|
|||||||
mChooserState.setValues(mActivity, ascii, scancode);
|
mChooserState.setValues(mActivity, ascii, scancode);
|
||||||
Apple2Preferences.nativeSetCurrentTouchDevice(Apple2Preferences.TouchDeviceVariant.JOYSTICK_KEYPAD.ordinal());
|
Apple2Preferences.nativeSetCurrentTouchDevice(Apple2Preferences.TouchDeviceVariant.JOYSTICK_KEYPAD.ordinal());
|
||||||
mCurrentChoicePrompt.setText(getNextChoiceString() + asciiStr);
|
mCurrentChoicePrompt.setText(getNextChoiceString() + asciiStr);
|
||||||
switch(mChooserState) {
|
switch (mChooserState) {
|
||||||
case CHOOSE_TAP:
|
case CHOOSE_TAP:
|
||||||
mActivity.nativeOnTouch(MotionEvent.ACTION_DOWN, 1, 0, new float[]{400.f}, new float[]{400.f});
|
mActivity.nativeOnTouch(MotionEvent.ACTION_DOWN, 1, 0, new float[]{400.f}, new float[]{400.f});
|
||||||
mActivity.nativeOnTouch(MotionEvent.ACTION_UP, 1, 0, new float[]{400.f}, new float[]{400.f});
|
mActivity.nativeOnTouch(MotionEvent.ACTION_UP, 1, 0, new float[]{400.f}, new float[]{400.f});
|
||||||
@ -135,6 +136,14 @@ public class Apple2KeypadChooser implements Apple2MenuView {
|
|||||||
mCurrentChoicePrompt = (TextView) mSettingsView.findViewById(R.id.currentChoicePrompt);
|
mCurrentChoicePrompt = (TextView) mSettingsView.findViewById(R.id.currentChoicePrompt);
|
||||||
mCurrentChoicePrompt.setText(getNextChoiceString());
|
mCurrentChoicePrompt.setText(getNextChoiceString());
|
||||||
|
|
||||||
|
Button skipButton = (Button) mSettingsView.findViewById(R.id.skipButton);
|
||||||
|
skipButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Apple2KeypadChooser.this.onKeyTapCalibrationEvent((char)Apple2KeyboardSettingsMenu.ICONTEXT_NONACTION, -1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// temporarily undo these native touch settings while calibrating...
|
// temporarily undo these native touch settings while calibrating...
|
||||||
mTouchMenuEnabled = Apple2Preferences.TOUCH_MENU_ENABLED.booleanValue(mActivity);
|
mTouchMenuEnabled = Apple2Preferences.TOUCH_MENU_ENABLED.booleanValue(mActivity);
|
||||||
Apple2Preferences.nativeSetTouchMenuEnabled(false);
|
Apple2Preferences.nativeSetTouchMenuEnabled(false);
|
||||||
|
@ -2,21 +2,36 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="0dp"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginRight="0dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:layout_marginTop="0dp"
|
|
||||||
android:layout_marginBottom="0dp"
|
android:layout_marginBottom="0dp"
|
||||||
|
android:layout_marginEnd="0dp"
|
||||||
|
android:layout_marginLeft="0dp"
|
||||||
|
android:layout_marginRight="0dp"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="#00ff0000">
|
android:background="#00ff0000">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/currentChoicePrompt"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/keypad_choose_current"
|
|
||||||
android:id="@+id/currentChoicePrompt"
|
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentStart="true" />
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginLeft="@dimen/preference_margin_left"
|
||||||
|
android:layout_marginStart="@dimen/preference_margin_left"
|
||||||
|
android:layout_marginTop="@dimen/preference_margin_top"
|
||||||
|
android:text="@string/keypad_choose_current" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/skipButton"
|
||||||
|
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/skip" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -145,6 +145,7 @@
|
|||||||
<string name="reboot_really">Reboot emulator?</string>
|
<string name="reboot_really">Reboot emulator?</string>
|
||||||
<string name="reboot_summary"></string>
|
<string name="reboot_summary"></string>
|
||||||
<string name="reboot_warning">You will lose unsaved progress</string>
|
<string name="reboot_warning">You will lose unsaved progress</string>
|
||||||
|
<string name="skip">Skip→</string>
|
||||||
<string name="spacer"></string>
|
<string name="spacer"></string>
|
||||||
<string name="speaker_disabled_title">Speaker disabled</string>
|
<string name="speaker_disabled_title">Speaker disabled</string>
|
||||||
<string name="speaker_disabled_mesg">Speaker could not be enabled</string>
|
<string name="speaker_disabled_mesg">Speaker could not be enabled</string>
|
||||||
|
@ -309,7 +309,7 @@ static inline int64_t _tap_key_at_point(float x, float y) {
|
|||||||
|
|
||||||
case ICONTEXT_NONACTIONABLE:
|
case ICONTEXT_NONACTIONABLE:
|
||||||
scancode = 0;
|
scancode = 0;
|
||||||
handled = isCalibrating;
|
handled = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ICONTEXT_CTRL:
|
case ICONTEXT_CTRL:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user