add warning about unlimited SMS plans that's triggered whenever a new

number is added to the list of possible invitees.
This commit is contained in:
Eric House 2012-04-23 20:07:44 -07:00
parent 010fae495b
commit 6930da9686
2 changed files with 16 additions and 6 deletions

View file

@ -1924,4 +1924,6 @@
<string name="connect_label_sms">Connection (via SMS/text)</string>
<string name="phone_label">Connected number[s]:</string>
<string name="summary_conn_sms">Game in play with %s</string>
<string name="warn_unlimited">Are you certain this number is on an
account with unlimited texting? Click cancel if you are not.</string>
</resources>

View file

@ -57,6 +57,7 @@ public class SMSInviteActivity extends InviteActivity {
private static final int CLEAR_ACTION = 1;
private static final int USE_IMMOBILE_ACTION = 2;
private static final int POST_WARNING_ACTION = 3;
private ArrayList<PhoneRec> m_phoneRecs;
private SMSPhonesAdapter m_adapter;
@ -131,8 +132,11 @@ public class SMSInviteActivity extends InviteActivity {
public void onClick( DialogInterface dlg, int item ) {
String number = namerView.getName();
PhoneRec rec = new PhoneRec( number );
addChecked( rec );
saveAndRebuild();
m_pendingNumber = number;
m_pendingName = null;
showConfirmThen( R.string.warn_unlimited,
R.string.button_yes,
POST_WARNING_ACTION );
}
};
dialog = new AlertDialog.Builder( this )
@ -193,6 +197,10 @@ public class SMSInviteActivity extends InviteActivity {
clearSelectedImpl();
break;
case USE_IMMOBILE_ACTION:
showConfirmThen( R.string.warn_unlimited, R.string.button_yes,
POST_WARNING_ACTION );
break;
case POST_WARNING_ACTION:
addChecked( new PhoneRec( m_pendingName, m_pendingNumber ) );
saveAndRebuild();
break;
@ -229,12 +237,12 @@ public class SMSInviteActivity extends InviteActivity {
cursor.getString( cursor.getColumnIndex( Phone.NUMBER ) );
int type = cursor.getInt( cursor.getColumnIndex( Phone.TYPE ) );
m_pendingName = name;
m_pendingNumber = number;
if ( Phone.TYPE_MOBILE == type ) {
addChecked( new PhoneRec( name, number ) );
saveAndRebuild();
showConfirmThen( R.string.warn_unlimited, R.string.button_yes,
POST_WARNING_ACTION );
} else {
m_pendingName = name;
m_pendingNumber = number;
String msg = Utils.format( this, R.string.warn_nomobilef,
number, name );
showConfirmThen( msg, R.string.button_yes, USE_IMMOBILE_ACTION );