From 959b2aec3355063aaeb39f15dfec0e2b9b666199 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 18 Jul 2016 09:19:09 -0700 Subject: [PATCH 1/3] don't dismiss alert when about to post it again On 4.2 and 4.3 at least, the dimiss comes after the second post causing that to be dismissed, leaving no alert and the app in some weird state where not even the back button works. It's been this way on those older versions since I redid invitations for beta 98. --- .../org/eehouse/android/xw4/BoardDelegate.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java index 7d207229d..61e9e49c8 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -1570,7 +1570,7 @@ public class BoardDelegate extends DelegateBase private void handleConndMessage( String room, int devOrder, // <- hostID boolean allHere, int nMissing ) { - dismissInviteAlert( nMissing, true ); + boolean skipDismiss = false; int naMsg = 0; int naKey = 0; @@ -1598,6 +1598,7 @@ public class BoardDelegate extends DelegateBase m_room = room; showDialog( DlgID.DLG_INVITE ); invalidateOptionsMenuIf(); + skipDismiss = true; } else { toastStr = getQuantityString( R.plurals.msg_relay_waiting_fmt, nMissing, devOrder, room, nMissing ); @@ -1622,6 +1623,10 @@ public class BoardDelegate extends DelegateBase } } + if ( !skipDismiss ) { + dismissInviteAlert( nMissing, true ); // NO!!! + } + invalidateOptionsMenuIf(); } // handleConndMessage @@ -1926,26 +1931,30 @@ public class BoardDelegate extends DelegateBase public void informMissing( boolean isServer, CommsConnTypeSet connTypes, int nDevs, final int nMissing ) { + boolean doDismiss = true; m_connTypes = connTypes; Assert.assertTrue( isServer || 0 == nMissing ); // DbgUtils.logf( "BoardDelegate.informMissing(isServer=%b, nDevs=%d, nMissing=%d)", // isServer, nDevs, nMissing ); m_nGuestDevs = nDevs; - // If we might have put up an alert earlier, take it down - dismissInviteAlert( nMissing, !m_relayMissing ); - m_nMissing = nMissing; // will be 0 unless isServer is true if ( null != connTypes && 0 == connTypes.size() ) { askNoAddrsDelete(); } else if ( 0 < nMissing && isServer && !m_haveInvited ) { + doDismiss = false; post( new Runnable() { public void run() { showDialog( DlgID.DLG_INVITE ); } } ); } + + // If we might have put up an alert earlier, take it down + if ( doDismiss ) { + dismissInviteAlert( nMissing, !m_relayMissing ); + } } @Override From 01ffdb8b87f47399c8fa62ead1fe01dbedafb6ce Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 18 Jul 2016 09:27:33 -0700 Subject: [PATCH 2/3] up changes log to include new fix --- xwords4/android/XWords4/assets/changes.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/assets/changes.html b/xwords4/android/XWords4/assets/changes.html index 2e023aa81..452f4e4c0 100644 --- a/xwords4/android/XWords4/assets/changes.html +++ b/xwords4/android/XWords4/assets/changes.html @@ -15,7 +15,8 @@

Crosswords 4.4.108 release

-

This release improves in-game chat functionality.

+

This release fixes a nasty bug in invitations on older Android + and improves in-game chat functionality.