add more buttons; rearrange menus on assumption those that duplicate

button functionality can be burried.
This commit is contained in:
Andy2 2010-06-26 22:02:02 -07:00
parent 06a7c56ca9
commit 85745d8ab4
2 changed files with 77 additions and 39 deletions

View file

@ -1,29 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/board_menu_juggle" <!-- <item android:id="@+id/board_menu_juggle" -->
android:title="@string/board_menu_juggle" <!-- android:title="@string/board_menu_juggle" -->
android:alphabeticShortcut="J" <!-- android:alphabeticShortcut="J" -->
/> <!-- /> -->
<item android:id="@+id/board_menu_trade" <item android:id="@+id/board_menu_trade"
android:title="@string/board_menu_trade" android:title="@string/board_menu_trade"
android:alphabeticShortcut="T" android:alphabeticShortcut="T"
/> />
<item android:title="@string/board_submenu_hint">
<menu>
<item android:id="@+id/board_menu_hint_next"
android:title="@string/board_menu_hint_next"
android:alphabeticShortcut="H"
/>
<item android:id="@+id/board_menu_hint"
android:title="@string/board_menu_hint"
/>
<item android:id="@+id/board_menu_values"
android:title="@string/board_menu_values"
android:alphabeticShortcut="V"
/>
</menu>
</item>
<item android:title="@string/board_submenu_undo"> <item android:title="@string/board_submenu_undo">
<menu> <menu>
<item android:id="@+id/board_menu_undo_current" <item android:id="@+id/board_menu_undo_current"
@ -40,11 +25,6 @@
android:alphabeticShortcut="H" android:alphabeticShortcut="H"
/> />
<item android:id="@+id/board_menu_done"
android:title="@string/board_menu_done"
android:alphabeticShortcut="D"
/>
<item android:id="@+id/board_menu_flip" <item android:id="@+id/board_menu_flip"
android:title="@string/board_menu_flip" android:title="@string/board_menu_flip"
android:alphabeticShortcut="F" android:alphabeticShortcut="F"
@ -64,6 +44,28 @@
android:title="@string/board_menu_game_resend" /> android:title="@string/board_menu_game_resend" />
</menu> </menu>
</item> </item>
<item android:title="@string/board_submenu_hint">
<menu>
<item android:id="@+id/board_menu_hint_next"
android:title="@string/board_menu_hint_next"
android:alphabeticShortcut="H"
/>
<item android:id="@+id/board_menu_hint"
android:title="@string/board_menu_hint"
/>
<item android:id="@+id/board_menu_values"
android:title="@string/board_menu_values"
android:alphabeticShortcut="V"
/>
</menu>
</item>
<item android:id="@+id/board_menu_done"
android:title="@string/board_menu_done"
android:alphabeticShortcut="D"
/>
<item android:id="@+id/board_menu_file_prefs" <item android:id="@+id/board_menu_file_prefs"
android:title="@string/menu_prefs" android:title="@string/menu_prefs"
android:alphabeticShortcut="P" android:alphabeticShortcut="P"

View file

@ -408,9 +408,9 @@ public class BoardActivity extends Activity implements UtilCtxt {
case R.id.board_menu_done: case R.id.board_menu_done:
cmd = JNIThread.JNICmd.CMD_COMMIT; cmd = JNIThread.JNICmd.CMD_COMMIT;
break; break;
case R.id.board_menu_juggle: // case R.id.board_menu_juggle:
cmd = JNIThread.JNICmd.CMD_JUGGLE; // cmd = JNIThread.JNICmd.CMD_JUGGLE;
break; // break;
case R.id.board_menu_flip: case R.id.board_menu_flip:
cmd = JNIThread.JNICmd.CMD_FLIP; cmd = JNIThread.JNICmd.CMD_FLIP;
break; break;
@ -432,9 +432,9 @@ public class BoardActivity extends Activity implements UtilCtxt {
case R.id.board_menu_hint_next: case R.id.board_menu_hint_next:
cmd = JNIThread.JNICmd.CMD_NEXT_HINT; cmd = JNIThread.JNICmd.CMD_NEXT_HINT;
break; break;
case R.id.board_menu_values: // case R.id.board_menu_values:
cmd = JNIThread.JNICmd.CMD_VALUES; // cmd = JNIThread.JNICmd.CMD_VALUES;
break; // break;
case R.id.board_menu_game_counts: case R.id.board_menu_game_counts:
m_jniThread.handle( JNIThread.JNICmd.CMD_COUNTS_VALUES, m_jniThread.handle( JNIThread.JNICmd.CMD_COUNTS_VALUES,
@ -710,19 +710,55 @@ public class BoardActivity extends Activity implements UtilCtxt {
getResources().getConfiguration().orientation getResources().getConfiguration().orientation
== Configuration.ORIENTATION_LANDSCAPE; == Configuration.ORIENTATION_LANDSCAPE;
m_toolbar.orientChanged( isLandscape ); m_toolbar.orientChanged( isLandscape );
populateToolbar();
View.OnClickListener listener =
new View.OnClickListener() {
@Override
public void onClick( View view ) {
m_jniThread.handle( JNIThread.JNICmd.CMD_NEXT_HINT );
}
};
m_toolbar.addButton( this, "?", listener );
} }
} }
} // loadGame } // loadGame
private void populateToolbar()
{
View.OnClickListener listener =
new View.OnClickListener() {
@Override
public void onClick( View view ) {
m_jniThread.handle( JNIThread.JNICmd.CMD_NEXT_HINT );
}
};
m_toolbar.addButton( this, "<?>", listener );
listener = new View.OnClickListener() {
@Override
public void onClick( View view ) {
m_jniThread.handle( JNIThread.JNICmd.CMD_JUGGLE );
}
};
m_toolbar.addButton( this, "<S>", listener );
listener = new View.OnClickListener() {
@Override
public void onClick( View view ) {
m_jniThread.handle( JNIThread.JNICmd.CMD_COMMIT );
}
};
m_toolbar.addButton( this, "<D>", listener );
listener = new View.OnClickListener() {
@Override
public void onClick( View view ) {
m_jniThread.handle( JNIThread.JNICmd.CMD_FLIP );
}
};
m_toolbar.addButton( this, "<F>", listener );
listener = new View.OnClickListener() {
@Override
public void onClick( View view ) {
m_jniThread.handle( JNIThread.JNICmd.CMD_VALUES );
}
};
m_toolbar.addButton( this, "<V>", listener );
}
private DialogInterface.OnDismissListener makeODLforBlocking() private DialogInterface.OnDismissListener makeODLforBlocking()
{ {
return new DialogInterface.OnDismissListener() { return new DialogInterface.OnDismissListener() {