mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
put the pass/turn done menuitem in the action bar as a first cut
This commit is contained in:
parent
c294ad45cf
commit
ec77be8a2a
2 changed files with 18 additions and 7 deletions
|
@ -6,6 +6,7 @@
|
||||||
<!-- title set in BoardActivity -->
|
<!-- title set in BoardActivity -->
|
||||||
<item android:id="@+id/board_menu_done"
|
<item android:id="@+id/board_menu_done"
|
||||||
android:alphabeticShortcut="D"
|
android:alphabeticShortcut="D"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
/>
|
/>
|
||||||
<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"
|
||||||
|
@ -21,7 +22,8 @@
|
||||||
<item android:id="@+id/board_menu_tray"
|
<item android:id="@+id/board_menu_tray"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<item android:title="@string/board_submenu_game">
|
<item android:id="@+id/board_submenu_game"
|
||||||
|
android:title="@string/board_submenu_game">
|
||||||
<menu>
|
<menu>
|
||||||
<item android:id="@+id/board_menu_game_counts"
|
<item android:id="@+id/board_menu_game_counts"
|
||||||
android:title="@string/board_menu_game_counts" />
|
android:title="@string/board_menu_game_counts" />
|
||||||
|
|
|
@ -738,15 +738,22 @@ public class BoardActivity extends XWActivity
|
||||||
item.setTitle( strId );
|
item.setTitle( strId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utils.setItemVisible( menu, R.id.board_menu_undo_last, !inTrade );
|
||||||
|
Utils.setItemVisible( menu, R.id.board_menu_tray, !inTrade );
|
||||||
|
Utils.setItemVisible( menu, R.id.board_submenu_game, !inTrade );
|
||||||
|
|
||||||
if ( !inTrade ) {
|
if ( !inTrade ) {
|
||||||
|
boolean enabled = null == m_gsi || m_gsi.curTurnSelected;
|
||||||
item = menu.findItem( R.id.board_menu_done );
|
item = menu.findItem( R.id.board_menu_done );
|
||||||
if ( 0 >= m_view.curPending() ) {
|
item.setVisible( enabled );
|
||||||
strId = R.string.board_menu_pass;
|
if ( enabled ) {
|
||||||
} else {
|
if ( 0 >= m_view.curPending() ) {
|
||||||
strId = R.string.board_menu_done;
|
strId = R.string.board_menu_pass;
|
||||||
|
} else {
|
||||||
|
strId = R.string.board_menu_done;
|
||||||
|
}
|
||||||
|
item.setTitle( strId );
|
||||||
}
|
}
|
||||||
item.setTitle( strId );
|
|
||||||
item.setEnabled( null == m_gsi || m_gsi.curTurnSelected );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_gameOver || DBUtils.gameOver( this, m_rowid ) ) {
|
if ( m_gameOver || DBUtils.gameOver( this, m_rowid ) ) {
|
||||||
|
@ -1796,6 +1803,8 @@ public class BoardActivity extends XWActivity
|
||||||
m_view.setInTrade( m_inTrade );
|
m_view.setInTrade( m_inTrade );
|
||||||
}
|
}
|
||||||
adjustTradeVisibility();
|
adjustTradeVisibility();
|
||||||
|
Activity self = BoardActivity.this;
|
||||||
|
Utils.invalidateOptionsMenuIf( self );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case JNIThread.GOT_WORDS:
|
case JNIThread.GOT_WORDS:
|
||||||
|
|
Loading…
Reference in a new issue