mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +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.Perms23.Perm;
|
||||||
import org.eehouse.android.xw4.loc.LocUtils;
|
import org.eehouse.android.xw4.loc.LocUtils;
|
||||||
|
|
||||||
class InvitesNeededAlert implements DialogInterface.OnDismissListener {
|
class InvitesNeededAlert {
|
||||||
private static final String TAG = InvitesNeededAlert.class.getSimpleName();
|
private static final String TAG = InvitesNeededAlert.class.getSimpleName();
|
||||||
|
|
||||||
private DelegateBase mDelegate;
|
private DelegateBase mDelegate;
|
||||||
|
@ -116,16 +116,6 @@ class InvitesNeededAlert implements DialogInterface.OnDismissListener {
|
||||||
void onInfoClicked();
|
void onInfoClicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////
|
|
||||||
// DialogInterface.OnDismissListener
|
|
||||||
////////////////////////////////////////
|
|
||||||
@Override
|
|
||||||
public void onDismiss( DialogInterface dialog )
|
|
||||||
{
|
|
||||||
Log.d( TAG, "onDismiss()" );
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void close()
|
private void close()
|
||||||
{
|
{
|
||||||
DbgUtils.assertOnUIThread();
|
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 = ab.create();
|
||||||
result.setOnDismissListener( this );
|
result.setCanceledOnTouchOutside( false );
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue