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 df9f5e975..c486b0c5d 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 @@ -1580,15 +1580,15 @@ public class BoardDelegate extends DelegateBase callInviteChoices(); } - @Override - public void onInfoClicked( SentInvitesInfo sentInfo ) - { - String msg = sentInfo.getAsText( m_activity ); - makeOkOnlyBuilder( msg ) - .setTitle( R.string.title_invite_history ) - .setAction( Action.INVITE_INFO ) - .show(); - } + // @Override + // public void onInfoClicked( SentInvitesInfo sentInfo ) + // { + // String msg = sentInfo.getAsText( m_activity ); + // makeOkOnlyBuilder( msg ) + // .setTitle( R.string.title_invite_history ) + // .setAction( Action.INVITE_INFO ) + // .show(); + // } @Override public long getRowID() @@ -2583,8 +2583,9 @@ public class BoardDelegate extends DelegateBase private void showOrHide( InvitesNeededAlert.Wrapper wrapper ) { + boolean fromRematch = XwJNI.server_isFromRematch( m_jniGamePtr ); wrapper.showOrHide( m_mySIS.hostAddr, m_mySIS.nMissing, - m_mySIS.nInvited, false ); + m_mySIS.nInvited, fromRematch ); } private InvitesNeededAlert.Wrapper mINAWrapper; diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InvitesNeededAlert.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InvitesNeededAlert.java index d195b9f9a..c53f3086c 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InvitesNeededAlert.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InvitesNeededAlert.java @@ -128,7 +128,7 @@ class InvitesNeededAlert { long getRowID(); void onCloseClicked(); void onInviteClicked(); - void onInfoClicked( SentInvitesInfo sentInfo ); + // void onInfoClicked( SentInvitesInfo sentInfo ); } private boolean close() @@ -236,7 +236,7 @@ class InvitesNeededAlert { SentInvitesInfo sentInfo = DBUtils.getInvitesFor( context, rowid ); int nSent = state.mNInvited + sentInfo.getMinPlayerCount(); - boolean invitesNeeded = nPlayersMissing > nSent; + boolean invitesNeeded = nPlayersMissing > nSent && !state.mIsRematch; String title; boolean isRematch = state.mIsRematch; @@ -250,7 +250,7 @@ class InvitesNeededAlert { ab.setTitle( title ); String message; - int inviteButtonTxt; + int inviteButtonTxt = 0; if ( invitesNeeded ) { Assert.assertTrueNR( !isRematch ); message = LocUtils.getString( context, R.string.invites_unsent ); @@ -262,8 +262,11 @@ class InvitesNeededAlert { if ( isRematch ) { message += "\n\n" + LocUtils.getString( context, R.string.invite_msg_extra_rematch ); + } else { + inviteButtonTxt = R.string.newgame_reinvite; // here + message += "\n\n" + + LocUtils.getString( context, R.string.invite_msg_extra_norematch ); } - inviteButtonTxt = R.string.newgame_reinvite; } ab.setMessage( message ); @@ -278,19 +281,19 @@ class InvitesNeededAlert { if ( invitesNeeded ) { alert.setNoDismissListenerPos( ab, inviteButtonTxt, onInvite ); - } else { + } else if ( 0 != inviteButtonTxt ) { alert.setNoDismissListenerNeg( ab, inviteButtonTxt, onInvite ); closeLoc[0] = DialogInterface.BUTTON_POSITIVE; } - if ( BuildConfig.NON_RELEASE && 0 < nSent ) { - alert.setNoDismissListenerNeut( ab, R.string.button_invite_history, - new OnClickListener() { - @Override - public void onClick( DialogInterface dlg, int item ) { - callbacks.onInfoClicked( sentInfo ); - } - } ); - } + // if ( BuildConfig.NON_RELEASE && 0 < nSent ) { + // alert.setNoDismissListenerNeut( ab, R.string.button_invite_history, + // new OnClickListener() { + // @Override + // public void onClick( DialogInterface dlg, int item ) { + // callbacks.onInfoClicked( sentInfo ); + // } + // } ); + // } } } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/XwJNI.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/XwJNI.java index d109e8366..efdf48f5f 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/XwJNI.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/XwJNI.java @@ -551,6 +551,7 @@ public class XwJNI { public static native String server_writeFinalScores( GamePtr gamePtr ); public static native boolean server_initClientConnection( GamePtr gamePtr ); public static native boolean server_canOfferRematch( GamePtr gamePtr ); + public static native boolean server_isFromRematch( GamePtr gamePtr ); public static native void server_endGame( GamePtr gamePtr ); // hybrid to save work diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index d4ebd5766..fe0bd36a7 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -455,20 +455,22 @@ player to receive and respond to an invitation. \n\nYou will see this message until the invited player has - responded. If you suspect the invitation you sent was lost, - there’s no harm in sending another. + responded. This game is waiting for %1$d remote players to repond to invitations. \n\nYou will see this message until all expected players have - responded. If you suspect any invitations you sent were lost, - there’s no harm in sending more. + responded. + + If you suspect an invitation you sent was lost, there’s no harm + in sending another. + With rematches, all - necessary invitations will have been sent automatically. But you - can always send new ones if an invitee is not responding. + necessary invitations will have been created automatically and + will be resent until they are accepted.