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"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/board_menu_juggle"
android:title="@string/board_menu_juggle"
android:alphabeticShortcut="J"
/>
<!-- <item android:id="@+id/board_menu_juggle" -->
<!-- android:title="@string/board_menu_juggle" -->
<!-- android:alphabeticShortcut="J" -->
<!-- /> -->
<item android:id="@+id/board_menu_trade"
android:title="@string/board_menu_trade"
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">
<menu>
<item android:id="@+id/board_menu_undo_current"
@ -40,11 +25,6 @@
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"
android:title="@string/board_menu_flip"
android:alphabeticShortcut="F"
@ -64,6 +44,28 @@
android:title="@string/board_menu_game_resend" />
</menu>
</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"
android:title="@string/menu_prefs"
android:alphabeticShortcut="P"

View file

@ -408,9 +408,9 @@ public class BoardActivity extends Activity implements UtilCtxt {
case R.id.board_menu_done:
cmd = JNIThread.JNICmd.CMD_COMMIT;
break;
case R.id.board_menu_juggle:
cmd = JNIThread.JNICmd.CMD_JUGGLE;
break;
// case R.id.board_menu_juggle:
// cmd = JNIThread.JNICmd.CMD_JUGGLE;
// break;
case R.id.board_menu_flip:
cmd = JNIThread.JNICmd.CMD_FLIP;
break;
@ -432,9 +432,9 @@ public class BoardActivity extends Activity implements UtilCtxt {
case R.id.board_menu_hint_next:
cmd = JNIThread.JNICmd.CMD_NEXT_HINT;
break;
case R.id.board_menu_values:
cmd = JNIThread.JNICmd.CMD_VALUES;
break;
// case R.id.board_menu_values:
// cmd = JNIThread.JNICmd.CMD_VALUES;
// break;
case R.id.board_menu_game_counts:
m_jniThread.handle( JNIThread.JNICmd.CMD_COUNTS_VALUES,
@ -710,19 +710,55 @@ public class BoardActivity extends Activity implements UtilCtxt {
getResources().getConfiguration().orientation
== Configuration.ORIENTATION_LANDSCAPE;
m_toolbar.orientChanged( isLandscape );
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 );
populateToolbar();
}
}
} // 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()
{
return new DialogInterface.OnDismissListener() {