From d40b8b7cad2b9f4a1cd07e21a28ef54936a96d8f Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 19 Jul 2018 06:29:59 -0700 Subject: [PATCH] dismiss the BT invite progress thing on success Not sure how this broke in the reorg of XWService stuff, but let's be agressive about dismissing that thing. --- .../org/eehouse/android/xw4/BoardDelegate.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java index 4985e0701..447379d85 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java @@ -1257,12 +1257,14 @@ public class BoardDelegate extends DelegateBase @SuppressWarnings("fallthrough") public void eventOccurred( MultiService.MultiEvent event, final Object ... args ) { + boolean doStopProgress = false; switch( event ) { case MESSAGE_ACCEPTED: case MESSAGE_REFUSED: ConnStatusHandler. updateStatusIn( m_activity, this, CommsConnType.COMMS_CONN_BT, MultiService.MultiEvent.MESSAGE_ACCEPTED == event); + doStopProgress = true; break; case MESSAGE_NOGAME: int gameID = (Integer)args[0]; @@ -1285,10 +1287,7 @@ public class BoardDelegate extends DelegateBase Log.w( TAG, "failed to create game" ); break; case NEWGAME_DUP_REJECTED: - if ( m_progressShown ) { - m_progressShown = false; - stopProgress(); // in case it's a BT invite - } + doStopProgress = true; final String msg = getString( R.string.err_dup_invite_fmt, (String)args[0] ); post( new Runnable() { @@ -1311,13 +1310,15 @@ public class BoardDelegate extends DelegateBase break; default: - if ( m_progressShown ) { - m_progressShown = false; - stopProgress(); // in case it's a BT invite - } + doStopProgress = true; // in case it's a BT invite super.eventOccurred( event, args ); break; } + + if ( doStopProgress && m_progressShown ) { + m_progressShown = false; + stopProgress(); + } } //////////////////////////////////////////////////