mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-13 12:31:25 +00:00
Simplify and coalesce touch menu settings into keyboard settings for now
This commit is contained in:
parent
b1cbe44a05
commit
39c654ae9d
@ -91,10 +91,34 @@ public class Apple2KeyboardSettingsMenu extends Apple2AbstractMenu {
|
||||
if (position < 0 || position >= SETTINGS.size) {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
return true;
|
||||
return (position != SETTINGS.KEYBOARD_VISIBILITY_INACTIVE.ordinal() && position != SETTINGS.KEYBOARD_VISIBILITY_ACTIVE.ordinal());
|
||||
}
|
||||
|
||||
protected enum SETTINGS implements Apple2AbstractMenu.IMenuEnum {
|
||||
TOUCH_MENU_ENABLED {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.touch_menu_enable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getSummary(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.touch_menu_enable_summary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final Apple2Activity activity, View convertView) {
|
||||
convertView = _basicView(activity, this, convertView);
|
||||
CheckBox cb = _addCheckbox(activity, this, convertView, Apple2Preferences.TOUCH_MENU_ENABLED.booleanValue(activity));
|
||||
cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
Apple2Preferences.TOUCH_MENU_ENABLED.saveBoolean(activity, isChecked);
|
||||
}
|
||||
});
|
||||
return convertView;
|
||||
}
|
||||
},
|
||||
KEYBOARD_VISIBILITY_INACTIVE {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
|
@ -277,19 +277,6 @@ public enum Apple2Preferences {
|
||||
return activity.getPreferences(Context.MODE_PRIVATE).getBoolean(toString(), true);
|
||||
}
|
||||
},
|
||||
TOUCH_MENU_VISIBILITY {
|
||||
@Override
|
||||
public void load(Apple2Activity activity) {
|
||||
int setting = intValue(activity);
|
||||
float alpha = (float) setting / AUDIO_LATENCY_NUM_CHOICES;
|
||||
nativeSetTouchMenuVisibility(alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int intValue(Apple2Activity activity) {
|
||||
return activity.getPreferences(Context.MODE_PRIVATE).getInt(toString(), 5);
|
||||
}
|
||||
},
|
||||
SHOW_DISK_OPERATIONS {
|
||||
@Override
|
||||
public void load(Apple2Activity activity) {
|
||||
@ -1068,8 +1055,6 @@ public enum Apple2Preferences {
|
||||
|
||||
public static native void nativeSetTouchMenuEnabled(boolean enabled);
|
||||
|
||||
private static native void nativeSetTouchMenuVisibility(float alpha);
|
||||
|
||||
public static native void nativeSetShowDiskOperationAnimation(boolean enabled);
|
||||
|
||||
private static native void nativeSetTouchKeyboardVisibility(float inactiveAlpha, float activeAlpha);
|
||||
|
@ -52,7 +52,7 @@ public class Apple2SettingsMenu extends Apple2AbstractMenu {
|
||||
if (position < 0 || position >= SETTINGS.size) {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
return position != SETTINGS.TOUCH_MENU_VISIBILITY.ordinal();
|
||||
return true;
|
||||
}
|
||||
|
||||
enum SETTINGS implements Apple2AbstractMenu.IMenuEnum {
|
||||
@ -194,61 +194,6 @@ public class Apple2SettingsMenu extends Apple2AbstractMenu {
|
||||
});
|
||||
}
|
||||
},
|
||||
TOUCH_MENU_ENABLED {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.touch_menu_enable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getSummary(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.touch_menu_enable_summary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final Apple2Activity activity, View convertView) {
|
||||
convertView = _basicView(activity, this, convertView);
|
||||
CheckBox cb = _addCheckbox(activity, this, convertView, Apple2Preferences.TOUCH_MENU_ENABLED.booleanValue(activity));
|
||||
cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
Apple2Preferences.TOUCH_MENU_ENABLED.saveBoolean(activity, isChecked);
|
||||
}
|
||||
});
|
||||
return convertView;
|
||||
}
|
||||
},
|
||||
TOUCH_MENU_VISIBILITY {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.touch_menu_visibility);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getSummary(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.touch_menu_visibility_summary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final Apple2Activity activity, View convertView) {
|
||||
return _sliderView(activity, this, Apple2Preferences.ALPHA_SLIDER_NUM_CHOICES, new IPreferenceSlider() {
|
||||
@Override
|
||||
public void saveInt(int progress) {
|
||||
Apple2Preferences.TOUCH_MENU_VISIBILITY.saveInt(activity, progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int intValue() {
|
||||
return Apple2Preferences.TOUCH_MENU_VISIBILITY.intValue(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showValue(int progress, final TextView seekBarValue) {
|
||||
seekBarValue.setText("" + ((float) progress / Apple2Preferences.ALPHA_SLIDER_NUM_CHOICES));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
SHOW_DISK_OPERATIONS {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
|
@ -87,9 +87,9 @@
|
||||
<string name="keyboard_lowercase_enabled">Enable lowercase</string>
|
||||
<string name="keyboard_lowercase_enabled_summary">Enable lowercase keys</string>
|
||||
<string name="keyboard_visibility_active">Visibility when active</string>
|
||||
<string name="keyboard_visibility_active_summary">Keyboard visibility when active</string>
|
||||
<string name="keyboard_visibility_active_summary">Keyboard and touch menu visibility when active</string>
|
||||
<string name="keyboard_visibility_inactive">Visibility when inactive</string>
|
||||
<string name="keyboard_visibility_inactive_summary">Keyboard visibility when inactive</string>
|
||||
<string name="keyboard_visibility_inactive_summary">Keyboard and touch menu visibility when inactive</string>
|
||||
<string name="keypad">Keypad Joystick</string>
|
||||
<string name="keypad_calibrate">@string/joystick_calibrate</string>
|
||||
<string name="keypad_calibrate_summary">@string/joystick_calibrate</string>
|
||||
@ -154,8 +154,6 @@
|
||||
<string name="settings_advanced_joystick_summary">Advanced settings and performance tuning</string>
|
||||
<string name="touch_menu_enable">Enable touch menus</string>
|
||||
<string name="touch_menu_enable_summary">Enables soft menu buttons in top screen corners</string>
|
||||
<string name="touch_menu_visibility">Touch menu visibility</string>
|
||||
<string name="touch_menu_visibility_summary">Touch menu visibility when inactive</string>
|
||||
<string name="video_configure">Configure video…</string>
|
||||
<string name="video_configure_summary">Color settings</string>
|
||||
|
||||
|
@ -87,9 +87,9 @@
|
||||
<string name="keyboard_lowercase_enabled">Habilitar minúsculas</string>
|
||||
<string name="keyboard_lowercase_enabled_summary">Utilice las teclas minúsculas</string>
|
||||
<string name="keyboard_visibility_active">Visibilidad cuando está activo</string>
|
||||
<string name="keyboard_visibility_active_summary">Visibilidad del teclado cuando está activo</string>
|
||||
<string name="keyboard_visibility_active_summary">Visibilidad del teclado y menú cuando está activo</string>
|
||||
<string name="keyboard_visibility_inactive">Visibilidad cuando está inactivo</string>
|
||||
<string name="keyboard_visibility_inactive_summary">Visibilidad del teclado cuando está inactivo</string>
|
||||
<string name="keyboard_visibility_inactive_summary">Visibilidad del teclado y menú cuando está inactivo</string>
|
||||
<string name="keypad">Joystick como teclado numérico</string>
|
||||
<string name="keypad_calibrate">@string/joystick_calibrate</string>
|
||||
<string name="keypad_calibrate_summary">@string/joystick_calibrate</string>
|
||||
@ -154,8 +154,6 @@
|
||||
<string name="settings_advanced_joystick_summary">Configuración avanzada y optimización del rendimiento</string>
|
||||
<string name="touch_menu_enable">Activar menús táctiles</string>
|
||||
<string name="touch_menu_enable_summary">Los botones del menú en la parte superior de la pantalla</string>
|
||||
<string name="touch_menu_visibility">Visibilidad del menú</string>
|
||||
<string name="touch_menu_visibility_summary">Visibilidad del menú cuando está inactivo</string>
|
||||
<string name="video_configure">Configurar el video…</string>
|
||||
<string name="video_configure_summary">Ajustes de color</string>
|
||||
|
||||
|
@ -87,9 +87,9 @@
|
||||
<string name="keyboard_lowercase_enabled">Permettre les minuscules</string>
|
||||
<string name="keyboard_lowercase_enabled_summary">Permettre les touches en minuscules</string>
|
||||
<string name="keyboard_visibility_active">Visibilité quand actif</string>
|
||||
<string name="keyboard_visibility_active_summary">Voir le clavier quand actif</string>
|
||||
<string name="keyboard_visibility_active_summary">Clavier et menu tactile visible quand actif</string>
|
||||
<string name="keyboard_visibility_inactive">Visibilité quand inactif</string>
|
||||
<string name="keyboard_visibility_inactive_summary">Clavier visible quand inactif</string>
|
||||
<string name="keyboard_visibility_inactive_summary">Clavier et menu tactile visible quand inactif</string>
|
||||
<string name="keypad">Keypad Joystick</string>
|
||||
<string name="keypad_calibrate">@string/joystick_calibrate</string>
|
||||
<string name="keypad_calibrate_summary">@string/joystick_calibrate</string>
|
||||
@ -154,8 +154,6 @@
|
||||
<string name="settings_advanced_joystick_summary">Configuration avancée et tuning de performance</string>
|
||||
<string name="touch_menu_enable">Activation des menus tactiles</string>
|
||||
<string name="touch_menu_enable_summary">Activation soft des bouton du menu dans les coins en haut de l\'écran</string>
|
||||
<string name="touch_menu_visibility">Visibilité du menu tactile</string>
|
||||
<string name="touch_menu_visibility_summary">Menu tactile visible quand inactif</string>
|
||||
<string name="video_configure">Configuration de la vidéo…</string>
|
||||
<string name="video_configure_summary">Configuration des couleurs</string>
|
||||
|
||||
|
@ -87,9 +87,9 @@
|
||||
<string name="keyboard_lowercase_enabled">Enable lowercase</string>
|
||||
<string name="keyboard_lowercase_enabled_summary">Enable lowercase keys</string>
|
||||
<string name="keyboard_visibility_active">Visibility when active</string>
|
||||
<string name="keyboard_visibility_active_summary">Keyboard visibility when active</string>
|
||||
<string name="keyboard_visibility_active_summary">Keyboard and touch menu visibility when active</string>
|
||||
<string name="keyboard_visibility_inactive">Visibility when inactive</string>
|
||||
<string name="keyboard_visibility_inactive_summary">Keyboard visibility when inactive</string>
|
||||
<string name="keyboard_visibility_inactive_summary">Keyboard and touch menu visibility when inactive</string>
|
||||
<string name="keypad">Keypad Joystick</string>
|
||||
<string name="keypad_calibrate">@string/joystick_calibrate</string>
|
||||
<string name="keypad_calibrate_summary">@string/joystick_calibrate</string>
|
||||
@ -154,8 +154,6 @@
|
||||
<string name="settings_advanced_joystick_summary">Advanced settings and performance tuning</string>
|
||||
<string name="touch_menu_enable">Enable touch menus</string>
|
||||
<string name="touch_menu_enable_summary">Enables soft menu buttons in top screen corners</string>
|
||||
<string name="touch_menu_visibility">Touch menu visibility</string>
|
||||
<string name="touch_menu_visibility_summary">Touch menu visibility when inactive</string>
|
||||
<string name="video_configure">Configure video…</string>
|
||||
<string name="video_configure_summary">Color settings</string>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user