For SMS and BT, text contains the text of a button. Substitute in

button text rather than have to keep the two in sync.
This commit is contained in:
Eric House 2014-09-25 07:34:58 -07:00
parent e0eb22854f
commit 47591fb8c6
6 changed files with 20 additions and 23 deletions

View file

@ -1863,7 +1863,7 @@
<string name="new_move_body">One or more moves has arrived</string>
<!-- -->
<string name="invite_bt_desc_fmt">Please select the %1$d device[s]
you want to include in this game. Use the \"Add all Paired\"
you want to include in this game. Use the \"%2$s\"
button if you don\'t see a device you expect.</string>
<!-- -->
<string name="bt_resend_fmt">Bluetooth send to %1$s failed; retry %3$d in
@ -1905,8 +1905,7 @@
<string name="button_sms_add">Import contact</string>
<!-- -->
<string name="invite_sms_desc_fmt">Please check the %1$d phone
number[s] you want to invite to your new game, then tap \"Invite
checked\".</string>
number[s] you want to invite to your new game, then tap \"%2$s\".</string>
<!-- -->
<string name="manual_owner_name">(Not in contacts)</string>
<!-- -->

View file

@ -1599,7 +1599,7 @@
<string name="new_move_body">Eno ro erom sevom sah devirra</string>
<!-- -->
<string name="invite_bt_desc_fmt">Esaelp tceles eht %1$d ]s[ecived
uoy tnaw ot edulcni ni siht emag. Esu eht \"Dda lla Deriap\"
uoy tnaw ot edulcni ni siht emag. Esu eht \"%2$s\"
nottub fi uoy nod\'t ees a ecived uoy tcepxe.</string>
<!-- -->
<string name="bt_resend_fmt">Htooteulb dnes ot %1$s deliaf; yrter %3$d ni
@ -1641,8 +1641,7 @@
<string name="button_sms_add">Tropmi tcatnoc</string>
<!-- -->
<string name="invite_sms_desc_fmt">Esaelp kcehc eht %1$d enohp
]s[rebmun uoy tnaw ot etivni ot ruoy wen ,emag neht pat \"Etivni
dekcehc\".</string>
]s[rebmun uoy tnaw ot etivni ot ruoy wen ,emag neht pat \"%2$s\".</string>
<!-- -->
<string name="manual_owner_name">tOn( ni )stcatnoc</string>
<!-- -->

View file

@ -1599,7 +1599,7 @@
<string name="new_move_body">ONE OR MORE MOVES HAS ARRIVED</string>
<!-- -->
<string name="invite_bt_desc_fmt">PLEASE SELECT THE %1$d DEVICE[S]
YOU WANT TO INCLUDE IN THIS GAME. USE THE \"ADD ALL PAIRED\"
YOU WANT TO INCLUDE IN THIS GAME. USE THE \"%2$s\"
BUTTON IF YOU DON\'T SEE A DEVICE YOU EXPECT.</string>
<!-- -->
<string name="bt_resend_fmt">BLUETOOTH SEND TO %1$s FAILED; RETRY %3$d IN
@ -1641,8 +1641,7 @@
<string name="button_sms_add">IMPORT CONTACT</string>
<!-- -->
<string name="invite_sms_desc_fmt">PLEASE CHECK THE %1$d PHONE
NUMBER[S] YOU WANT TO INVITE TO YOUR NEW GAME, THEN TAP \"INVITE
CHECKED\".</string>
NUMBER[S] YOU WANT TO INVITE TO YOUR NEW GAME, THEN TAP \"%2$s\".</string>
<!-- -->
<string name="manual_owner_name">(NOT IN CONTACTS)</string>
<!-- -->

View file

@ -51,7 +51,6 @@ import org.eehouse.android.xw4.DlgDelegate.Action;
public class BTInviteDelegate extends InviteDelegate {
private Activity m_activity;
private boolean m_firstScan;
private Set<Integer> m_checked;
private boolean m_setChecked;
private BTDevsAdapter m_adapter;
@ -74,10 +73,11 @@ public class BTInviteDelegate extends InviteDelegate {
protected void init( Bundle savedInstanceState )
{
m_checked = new HashSet<Integer>();
String msg = getString( R.string.bt_pick_addall_button );
msg = getString( R.string.invite_bt_desc_fmt, m_nMissing, msg );
super.init( R.id.button_invite, R.id.button_rescan,
R.id.button_clear, R.id.invite_desc,
R.string.invite_bt_desc_fmt );
m_firstScan = true;
R.id.button_clear, R.id.invite_desc, msg );
BTService.clearDevices( m_activity, null ); // will return names
}
@ -109,7 +109,6 @@ public class BTInviteDelegate extends InviteDelegate {
setListAdapter( m_adapter );
m_checked.clear();
tryEnable();
m_firstScan = false;
}
}
} );

View file

@ -49,14 +49,13 @@ abstract class InviteDelegate extends ListDelegateBase
{
super( delegator, savedInstanceState, layoutID, R.menu.empty );
m_activity = delegator.getActivity();
Intent intent = getIntent();
m_nMissing = intent.getIntExtra( INTENT_KEY_NMISSING, -1 );
}
protected void init( int button_invite, int button_rescan,
int button_clear, int desc_id, int desc_strf )
int button_clear, int desc_id, String descTxt )
{
Intent intent = getIntent();
m_nMissing = intent.getIntExtra( INTENT_KEY_NMISSING, -1 );
m_okButton = (Button)findViewById( button_invite );
m_okButton.setOnClickListener( this );
m_rescanButton = (Button)findViewById( button_rescan );
@ -64,8 +63,8 @@ abstract class InviteDelegate extends ListDelegateBase
m_clearButton = (Button)findViewById( button_clear );
m_clearButton.setOnClickListener( this );
TextView desc = (TextView)findViewById( desc_id );
desc.setText( getString( desc_strf, m_nMissing ) );
TextView descView = (TextView)findViewById( desc_id );
descView.setText( descTxt );
tryEnable();
}

View file

@ -73,9 +73,11 @@ public class SMSInviteDelegate extends InviteDelegate {
protected void init( Bundle savedInstanceState )
{
super.init( R.id.button_invite, R.id.button_add,
R.id.button_clear, R.id.invite_desc,
R.string.invite_sms_desc_fmt );
String msg = getString( R.string.button_invite );
msg = getString( R.string.invite_sms_desc_fmt, m_nMissing, msg );
super.init( R.id.button_invite, R.id.button_add, R.id.button_clear,
R.id.invite_desc, msg );
getBundledData( savedInstanceState );
m_addButton = (ImageButton)findViewById( R.id.manual_add_button );