fix so board draws correctly when loaded in trade mode

This commit is contained in:
Eric House 2013-11-10 06:55:01 -08:00
parent 82a82b5ae1
commit 7457ce9b80
3 changed files with 6 additions and 4 deletions

View file

@ -767,7 +767,7 @@ public class BoardActivity extends XWActivity
item.setTitle( R.string.board_menu_game_final );
}
if ( DeviceRole.SERVER_STANDALONE == m_gi.serverRole ) {
if ( null != m_gi && 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 );
}
@ -1803,8 +1803,8 @@ public class BoardActivity extends XWActivity
updateToolbar();
if ( m_inTrade != m_gsi.inTrade ) {
m_inTrade = m_gsi.inTrade;
m_view.setInTrade( m_inTrade );
}
m_view.setInTrade( m_inTrade );
adjustTradeVisibility();
Activity self = BoardActivity.this;
Utils.invalidateOptionsMenuIf( self );

View file

@ -178,7 +178,10 @@ public class BoardCanvas extends Canvas implements DrawCtx {
public void setInTrade( boolean inTrade )
{
m_inTrade = inTrade;
if ( m_inTrade != inTrade ) {
m_inTrade = inTrade;
m_jniThread.handle( JNIThread.JNICmd.CMD_INVALALL );
}
}
// DrawCtxt interface implementation

View file

@ -321,7 +321,6 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
if ( null != m_canvas ) {
m_canvas.setInTrade( inTrade );
}
m_jniThread.handle( JNIThread.JNICmd.CMD_INVALALL );
}
public int getCurPlayer()