mirror of
https://github.com/jamessanford/kegs.git
synced 2025-01-23 07:30:01 +00:00
Start cleaning up options menu and ActionBar.
This commit is contained in:
parent
3f1de7eeca
commit
b8cb45b481
@ -5,26 +5,26 @@
|
||||
<item android:id="@+id/action_keyboard"
|
||||
android:icon="@drawable/ic_bt_keyboard_hid"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="Keyboard" />
|
||||
android:title="@+id/input_keyboard" />
|
||||
|
||||
<item android:id="@+id/action_joystick"
|
||||
android:icon="@drawable/ic_bt_misc_hid"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="Use Joystick" />
|
||||
android:title="@+id/input_joystick" />
|
||||
|
||||
<item android:id="@+id/action_speed"
|
||||
android:icon="@drawable/dial"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="Emulation Speed" />
|
||||
android:title="@+id/emulation_speed" />
|
||||
|
||||
<item android:id="@+id/action_function"
|
||||
android:icon="@drawable/ic_dialog_attach"
|
||||
android:showAsAction="never"
|
||||
android:title="Special Keys" />
|
||||
android:title="@+id/more_keys" />
|
||||
|
||||
<item android:id="@+id/action_diskimage"
|
||||
android:icon="@drawable/ic_menu_save"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="Disk Images" />
|
||||
android:title="@+id/diskimage" />
|
||||
|
||||
</menu>
|
||||
|
@ -1,13 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/input_mouse"
|
||||
android:title="@string/input_joystick" />
|
||||
<item android:id="@+id/input_keyboard"
|
||||
android:title="@string/input_keyboard" />
|
||||
<item android:id="@+id/input_controls"
|
||||
android:title="@string/input_controls_hide" />
|
||||
<item android:id="@+id/emulation_speed"
|
||||
android:title="@string/emulation_speed" />
|
||||
<item android:id="@+id/warm_reset"
|
||||
android:title="@string/warm_reset" />
|
||||
<item android:id="@+id/power_cycle"
|
||||
|
@ -21,13 +21,19 @@
|
||||
<item>Unlimited</item>
|
||||
</string-array>
|
||||
|
||||
<!-- R.menu.options -->
|
||||
<string name="diskimage_title">Load disk image</string>
|
||||
|
||||
<!-- R.menu.actions -->
|
||||
<string name="input_joystick">Use Joystick</string>
|
||||
<string name="input_mouse">Use Mouse</string>
|
||||
<string name="input_keyboard">Keyboard</string>
|
||||
<string name="emulation_speed">Emulation Speed</string>
|
||||
<string name="more_keys">Additional Keys</string>
|
||||
<string name="diskimage">Disk Images</string>
|
||||
|
||||
<!-- R.menu.options -->
|
||||
<string name="input_controls_hide">Hide Controls</string>
|
||||
<string name="input_controls_show">Show Controls</string>
|
||||
<string name="emulation_speed">Emulation Speed</string>
|
||||
<string name="warm_reset">Warm Reset</string>
|
||||
<string name="power_cycle">Power Cycle</string>
|
||||
</resources>
|
||||
|
@ -91,24 +91,11 @@ public class KegsMain extends Activity implements KegsKeyboard.StickyReset {
|
||||
private PopupMenu.OnMenuItemClickListener mSettingsClick = new PopupMenu.OnMenuItemClickListener() {
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
final int item_id = item.getItemId();
|
||||
if (item_id == R.id.input_mouse) {
|
||||
mModeMouse = !mModeMouse;
|
||||
return true;
|
||||
} else if (item_id == R.id.input_keyboard) {
|
||||
// There doesn't seem to be a reliable way to determine the current state, so we have to just toggle it.
|
||||
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (imm != null) {
|
||||
imm.toggleSoftInput(0, 0);
|
||||
}
|
||||
return true;
|
||||
} else if (item_id == R.id.input_controls) {
|
||||
if (item_id == R.id.input_controls) {
|
||||
final int vis = areControlsVisible() ? View.GONE : View.VISIBLE;
|
||||
findViewById(R.id.b1).setVisibility(vis);
|
||||
findViewById(R.id.b2).setVisibility(vis);
|
||||
return true;
|
||||
} else if (item_id == R.id.emulation_speed) {
|
||||
new SpeedFragment().show(getFragmentManager(), FRAGMENT_SPEED);
|
||||
return true;
|
||||
} else if (item_id == R.id.warm_reset) {
|
||||
getThread().doWarmReset();
|
||||
return true;
|
||||
@ -129,9 +116,6 @@ public class KegsMain extends Activity implements KegsKeyboard.StickyReset {
|
||||
private void updateSettingsMenu() {
|
||||
final Menu m = mSettingsMenu.getMenu();
|
||||
MenuItem item;
|
||||
item = m.findItem(R.id.input_mouse);
|
||||
item.setTitle(mModeMouse ? R.string.input_joystick : R.string.input_mouse);
|
||||
|
||||
item = m.findItem(R.id.input_controls);
|
||||
item.setTitle(areControlsVisible() ? R.string.input_controls_hide : R.string.input_controls_show);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user