mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
use showConfirmThen() for non-mobile numbers
This commit is contained in:
parent
8a4452ea53
commit
6ea692d430
2 changed files with 12 additions and 23 deletions
|
@ -1911,7 +1911,7 @@
|
||||||
<string name="manual_owner_name">(Entered manually)</string>
|
<string name="manual_owner_name">(Entered manually)</string>
|
||||||
|
|
||||||
<string name="warn_nomobilef">The number %1$s for %2$s is not
|
<string name="warn_nomobilef">The number %1$s for %2$s is not
|
||||||
marked as mobile.</string>
|
a \"mobile\" number. Import anyway?</string>
|
||||||
<string name="button_use">Use anyway</string>
|
<string name="button_use">Use anyway</string>
|
||||||
<string name="empty_sms_inviter">Phone list is empty. Use the
|
<string name="empty_sms_inviter">Phone list is empty. Use the
|
||||||
\"Import contact\" button to add people you want to
|
\"Import contact\" button to add people you want to
|
||||||
|
|
|
@ -51,12 +51,12 @@ import org.eehouse.android.xw4.jni.CommonPrefs;
|
||||||
public class SMSInviteActivity extends InviteActivity {
|
public class SMSInviteActivity extends InviteActivity {
|
||||||
|
|
||||||
private static final int GET_CONTACT = 1;
|
private static final int GET_CONTACT = 1;
|
||||||
private static final int CONFIRM_NON_MOBILE = DlgDelegate.DIALOG_LAST + 1;
|
private static final int GET_NUMBER = DlgDelegate.DIALOG_LAST + 1;
|
||||||
private static final int GET_NUMBER = DlgDelegate.DIALOG_LAST + 2;
|
|
||||||
private static final String SAVE_NAME = "SAVE_NAME";
|
private static final String SAVE_NAME = "SAVE_NAME";
|
||||||
private static final String SAVE_NUMBER = "SAVE_NUMBER";
|
private static final String SAVE_NUMBER = "SAVE_NUMBER";
|
||||||
|
|
||||||
private static final int CLEAR_ACTION = 1;
|
private static final int CLEAR_ACTION = 1;
|
||||||
|
private static final int USE_IMMOBILE_ACTION = 2;
|
||||||
|
|
||||||
private ArrayList<PhoneRec> m_phoneRecs;
|
private ArrayList<PhoneRec> m_phoneRecs;
|
||||||
private SMSPhonesAdapter m_adapter;
|
private SMSPhonesAdapter m_adapter;
|
||||||
|
@ -122,22 +122,6 @@ public class SMSInviteActivity extends InviteActivity {
|
||||||
if ( null == dialog ) {
|
if ( null == dialog ) {
|
||||||
DialogInterface.OnClickListener lstnr;
|
DialogInterface.OnClickListener lstnr;
|
||||||
switch( id ) {
|
switch( id ) {
|
||||||
case CONFIRM_NON_MOBILE:
|
|
||||||
lstnr = new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick( DialogInterface dlg, int item ) {
|
|
||||||
addChecked( new PhoneRec( m_pendingName,
|
|
||||||
m_pendingNumber ) );
|
|
||||||
saveAndRebuild();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
String msg = Utils.format( this, R.string.warn_nomobilef,
|
|
||||||
m_pendingNumber, m_pendingName );
|
|
||||||
dialog = new AlertDialog.Builder( this )
|
|
||||||
.setMessage( msg )
|
|
||||||
.setPositiveButton( R.string.button_ok, null )
|
|
||||||
.setNegativeButton( R.string.button_use, lstnr )
|
|
||||||
.create();
|
|
||||||
break;
|
|
||||||
case GET_NUMBER:
|
case GET_NUMBER:
|
||||||
final GameNamer namerView =
|
final GameNamer namerView =
|
||||||
(GameNamer)Utils.inflate( this, R.layout.rename_game );
|
(GameNamer)Utils.inflate( this, R.layout.rename_game );
|
||||||
|
@ -210,6 +194,10 @@ public class SMSInviteActivity extends InviteActivity {
|
||||||
case CLEAR_ACTION:
|
case CLEAR_ACTION:
|
||||||
clearSelectedImpl();
|
clearSelectedImpl();
|
||||||
break;
|
break;
|
||||||
|
case USE_IMMOBILE_ACTION:
|
||||||
|
addChecked( new PhoneRec( m_pendingName, m_pendingNumber ) );
|
||||||
|
saveAndRebuild();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,9 +225,8 @@ public class SMSInviteActivity extends InviteActivity {
|
||||||
Phone.TYPE },
|
Phone.TYPE },
|
||||||
null, null, null );
|
null, null, null );
|
||||||
if ( cursor.moveToFirst() ) {
|
if ( cursor.moveToFirst() ) {
|
||||||
String name = "";
|
String name =
|
||||||
int len_before = m_phoneRecs.size();
|
cursor.getString( cursor.getColumnIndex( Phone.DISPLAY_NAME));
|
||||||
name = cursor.getString( cursor.getColumnIndex( Phone.DISPLAY_NAME));
|
|
||||||
String number =
|
String number =
|
||||||
cursor.getString( cursor.getColumnIndex( Phone.NUMBER ) );
|
cursor.getString( cursor.getColumnIndex( Phone.NUMBER ) );
|
||||||
|
|
||||||
|
@ -250,7 +237,9 @@ public class SMSInviteActivity extends InviteActivity {
|
||||||
} else {
|
} else {
|
||||||
m_pendingName = name;
|
m_pendingName = name;
|
||||||
m_pendingNumber = number;
|
m_pendingNumber = number;
|
||||||
showDialog( CONFIRM_NON_MOBILE );
|
String msg = Utils.format( this, R.string.warn_nomobilef,
|
||||||
|
number, name );
|
||||||
|
showConfirmThen( msg, R.string.button_yes, USE_IMMOBILE_ACTION );
|
||||||
}
|
}
|
||||||
cursor.close();
|
cursor.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue