hide a couple of message-related menuitems for standalone games

This commit is contained in:
Eric House 2012-12-02 18:19:52 -08:00
parent 9eea15185c
commit 7621b909c3
2 changed files with 13 additions and 0 deletions

View file

@ -693,6 +693,11 @@ public class BoardActivity extends XWActivity
item.setTitle( R.string.board_menu_game_final );
}
if ( DeviceRole.SERVER_STANDALONE == m_gi.serverRole ) {
Utils.setItemVisible( menu, R.id.board_menu_game_resend, false );
Utils.setItemVisible( menu, R.id.gamel_menu_checkmoves, false );
}
return true;
} // onPrepareOptionsMenu

View file

@ -40,6 +40,8 @@ import android.net.Uri;
import android.provider.ContactsContract.PhoneLookup;
import android.telephony.TelephonyManager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
@ -345,6 +347,12 @@ public class Utils {
}
}
public static void setItemVisible( Menu menu, int id, boolean enabled )
{
MenuItem item = menu.findItem( id );
item.setVisible( enabled );
}
public static boolean hasSmallScreen( Context context )
{
if ( null == s_hasSmallScreen ) {