mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
close game when invite dialog dismissed via back button
Catch the onCancelled event, and treat as "close" button tap. Also disable cancel via taps outside the alert, which I think is less confusing than leaving the unplayable game up without the alert or closing it without explanation.
This commit is contained in:
parent
437aef5ed5
commit
386cfbda71
1 changed files with 11 additions and 12 deletions
|
@ -33,7 +33,7 @@ import org.eehouse.android.xw4.DlgDelegate.Action;
|
|||
import org.eehouse.android.xw4.Perms23.Perm;
|
||||
import org.eehouse.android.xw4.loc.LocUtils;
|
||||
|
||||
class InvitesNeededAlert implements DialogInterface.OnDismissListener {
|
||||
class InvitesNeededAlert {
|
||||
private static final String TAG = InvitesNeededAlert.class.getSimpleName();
|
||||
|
||||
private DelegateBase mDelegate;
|
||||
|
@ -116,16 +116,6 @@ class InvitesNeededAlert implements DialogInterface.OnDismissListener {
|
|||
void onInfoClicked();
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
// DialogInterface.OnDismissListener
|
||||
////////////////////////////////////////
|
||||
@Override
|
||||
public void onDismiss( DialogInterface dialog )
|
||||
{
|
||||
Log.d( TAG, "onDismiss()" );
|
||||
close();
|
||||
}
|
||||
|
||||
private void close()
|
||||
{
|
||||
DbgUtils.assertOnUIThread();
|
||||
|
@ -209,8 +199,17 @@ class InvitesNeededAlert implements DialogInterface.OnDismissListener {
|
|||
}
|
||||
} );
|
||||
|
||||
alert.setOnCancelListener( new XWDialogFragment.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancelled( XWDialogFragment frag ) {
|
||||
// Log.d( TAG, "onCancelled(frag=%s)", frag );
|
||||
callbacks.onCloseClicked();
|
||||
close();
|
||||
}
|
||||
} );
|
||||
|
||||
result = ab.create();
|
||||
result.setOnDismissListener( this );
|
||||
result.setCanceledOnTouchOutside( false );
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue