diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index 43179014f..6f42bf73b 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -745,16 +745,23 @@ public class BoardActivity extends XWActivity item = menu.findItem( R.id.board_menu_tray ); item.setTitle( strId ); - hideShowItem( menu, R.id.board_menu_flip, m_gsi.visTileCount >= 1 ); - hideShowItem( menu, R.id.board_menu_toggle, m_gsi.visTileCount >= 1 ); - hideShowItem( menu, R.id.board_menu_juggle, m_gsi.canShuffle ); - hideShowItem( menu, R.id.board_menu_undo_current, m_gsi.canRedo ); - hideShowItem( menu, R.id.board_menu_hint_prev, m_gsi.canHint ); - hideShowItem( menu, R.id.board_menu_hint_next, m_gsi.canHint ); - hideShowItem( menu, R.id.board_menu_chat, - BuildConstants.CHAT_SUPPORTED && m_gsi.canChat ); - hideShowItem( menu, R.id.board_menu_tray, - !inTrade && m_gsi.canHideRack ); + Utils.setItemVisible( menu, R.id.board_menu_flip, + m_gsi.visTileCount >= 1 ); + Utils.setItemVisible( menu, R.id.board_menu_toggle, + m_gsi.visTileCount >= 1 ); + Utils.setItemVisible( menu, R.id.board_menu_juggle, + m_gsi.canShuffle ); + Utils.setItemVisible( menu, R.id.board_menu_undo_current, + m_gsi.canRedo ); + Utils.setItemVisible( menu, R.id.board_menu_hint_prev, + m_gsi.canHint ); + Utils.setItemVisible( menu, R.id.board_menu_hint_next, + m_gsi.canHint ); + Utils.setItemVisible( menu, R.id.board_menu_chat, + BuildConstants.CHAT_SUPPORTED + && m_gsi.canChat ); + Utils.setItemVisible( menu, R.id.board_menu_tray, + !inTrade && m_gsi.canHideRack ); } Utils.setItemVisible( menu, R.id.board_menu_invite, 0 < m_missing ); @@ -2184,14 +2191,6 @@ public class BoardActivity extends XWActivity null != m_gi.dictName( m_view.getCurPlayer() ) ); } - private void hideShowItem( Menu menu, int id, boolean visible ) - { - MenuItem item = menu.findItem( id ); - if ( null != item ) { - item.setVisible( visible ); - } - } - private void adjustTradeVisibility() { m_toolbar.setVisibility( m_inTrade? View.GONE : View.VISIBLE );