mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-13 08:01:33 +01:00
when game opens and SMS is off, offer to turn it not rather than just
to open the Android settings app (as done in game config already)
This commit is contained in:
parent
0233ad6b79
commit
61649aab2d
3 changed files with 16 additions and 10 deletions
|
@ -907,7 +907,9 @@ public class BoardDelegate extends DelegateBase
|
|||
@Override
|
||||
public void dlgButtonClicked( Action action, int which, Object[] params )
|
||||
{
|
||||
boolean handled = false;
|
||||
if ( AlertDialog.BUTTON_POSITIVE == which ) {
|
||||
handled = true;
|
||||
JNICmd cmd = JNICmd.CMD_NONE;
|
||||
switch ( action ) {
|
||||
case UNDO_LAST_ACTION:
|
||||
|
@ -919,7 +921,6 @@ public class BoardDelegate extends DelegateBase
|
|||
case SMS_CONFIG_ACTION:
|
||||
Utils.launchSettings( m_activity );
|
||||
break;
|
||||
|
||||
case COMMIT_ACTION:
|
||||
cmd = JNICmd.CMD_COMMIT;
|
||||
break;
|
||||
|
@ -972,13 +973,17 @@ public class BoardDelegate extends DelegateBase
|
|||
GamesListDelegate.sendNFCToSelf( m_activity, makeNFCMessage() );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
handled = false;
|
||||
}
|
||||
|
||||
if ( JNICmd.CMD_NONE != cmd ) {
|
||||
checkAndHandle( cmd );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !handled ) {
|
||||
super.dlgButtonClicked( action, which, params );
|
||||
}
|
||||
} // dlgButtonClicked
|
||||
|
||||
public void inviteChoiceMade( Action action, InviteMeans means,
|
||||
|
@ -2220,8 +2225,9 @@ public class BoardDelegate extends DelegateBase
|
|||
if ( m_connTypes.contains( CommsConnType.COMMS_CONN_SMS ) ) {
|
||||
if ( XWApp.SMSSUPPORTED && !XWPrefs.getSMSEnabled( m_activity ) ) {
|
||||
showConfirmThen( R.string.warn_sms_disabled,
|
||||
R.string.button_go_settings,
|
||||
Action.SMS_CONFIG_ACTION );
|
||||
R.string.button_enable_sms,
|
||||
R.string.button_later,
|
||||
Action.ENABLE_SMS_ASK );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -523,6 +523,12 @@ public class DelegateBase implements DlgClickNotify,
|
|||
showSMSEnableDialog( Action.ENABLE_SMS_DO );
|
||||
handled = true;
|
||||
break;
|
||||
case ENABLE_SMS_DO:
|
||||
boolean enabled = (Boolean)params[0];
|
||||
if ( enabled ) {
|
||||
XWPrefs.setSMSEnabled( m_activity, true );
|
||||
}
|
||||
break;
|
||||
case ENABLE_BT_DO:
|
||||
BTService.enable();
|
||||
break;
|
||||
|
|
|
@ -655,12 +655,6 @@ public class GameConfigDelegate extends DelegateBase
|
|||
}
|
||||
finish();
|
||||
break;
|
||||
case ENABLE_SMS_DO:
|
||||
boolean enabled = (Boolean)params[0];
|
||||
if ( enabled ) {
|
||||
XWPrefs.setSMSEnabled( m_activity, true );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
callSuper = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue