remove method and use existing Util static instead

This commit is contained in:
Eric House 2013-12-01 20:32:17 -08:00
parent 968b1ba321
commit 3e6791c66f

View file

@ -745,16 +745,23 @@ public class BoardActivity extends XWActivity
item = menu.findItem( R.id.board_menu_tray ); item = menu.findItem( R.id.board_menu_tray );
item.setTitle( strId ); item.setTitle( strId );
hideShowItem( menu, R.id.board_menu_flip, m_gsi.visTileCount >= 1 ); Utils.setItemVisible( menu, R.id.board_menu_flip,
hideShowItem( menu, R.id.board_menu_toggle, m_gsi.visTileCount >= 1 ); m_gsi.visTileCount >= 1 );
hideShowItem( menu, R.id.board_menu_juggle, m_gsi.canShuffle ); Utils.setItemVisible( menu, R.id.board_menu_toggle,
hideShowItem( menu, R.id.board_menu_undo_current, m_gsi.canRedo ); m_gsi.visTileCount >= 1 );
hideShowItem( menu, R.id.board_menu_hint_prev, m_gsi.canHint ); Utils.setItemVisible( menu, R.id.board_menu_juggle,
hideShowItem( menu, R.id.board_menu_hint_next, m_gsi.canHint ); m_gsi.canShuffle );
hideShowItem( menu, R.id.board_menu_chat, Utils.setItemVisible( menu, R.id.board_menu_undo_current,
BuildConstants.CHAT_SUPPORTED && m_gsi.canChat ); m_gsi.canRedo );
hideShowItem( menu, R.id.board_menu_tray, Utils.setItemVisible( menu, R.id.board_menu_hint_prev,
!inTrade && m_gsi.canHideRack ); 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 ); 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() ) ); 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() private void adjustTradeVisibility()
{ {
m_toolbar.setVisibility( m_inTrade? View.GONE : View.VISIBLE ); m_toolbar.setVisibility( m_inTrade? View.GONE : View.VISIBLE );