mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-02 06:20:14 +01:00
include "sms" or "text" in chooser title
This commit is contained in:
parent
5eb937dede
commit
8ff27cc075
2 changed files with 11 additions and 4 deletions
|
@ -1197,11 +1197,11 @@
|
|||
have Crosswords installed.) The first uses defaults; the second
|
||||
lets you change them before beginning the game.</string>
|
||||
|
||||
<!-- The invitation process beging with this query. The choice is
|
||||
<!-- The invitation process begins with this query. The choice is
|
||||
between html and plaintext formatting but I also provide some
|
||||
explanation/guidance. -->
|
||||
<string name="sms_or_email">Send invitation using SMS (texting) or
|
||||
email?</string>
|
||||
via email?</string>
|
||||
|
||||
<!-- When an invitation is sent, the user gets to choose between
|
||||
plaintext and html formatting. These two strings are shown in the
|
||||
|
@ -1238,7 +1238,9 @@
|
|||
of the installed apps that can process the request he'd like
|
||||
to have launched. This string is passed to Android and used
|
||||
as the title of the dialog that presents that choice. -->
|
||||
<string name="invite_chooser">Send invitation via</string>
|
||||
<string name="invite_chooserf">Send invitation via %s</string>
|
||||
<string name="invite_chooser_email">email</string>
|
||||
<string name="invite_chooser_sms">sms</string>
|
||||
|
||||
<!-- Text of dialog asking user to confirm a move that exchanges
|
||||
tiles (instead of forming a new word to earn points) -->
|
||||
|
|
|
@ -508,6 +508,7 @@ public class GameUtils {
|
|||
|
||||
if ( null != gameUri ) {
|
||||
int fmtId = choseEmail? R.string.invite_htmf : R.string.invite_txtf;
|
||||
int choiceID;
|
||||
String format = context.getString( fmtId );
|
||||
String message = String.format( format, gameUri.toString() );
|
||||
|
||||
|
@ -519,13 +520,17 @@ public class GameUtils {
|
|||
Utils.format( context, R.string.invite_subjectf, room );
|
||||
intent.putExtra( Intent.EXTRA_SUBJECT, subject );
|
||||
intent.putExtra( Intent.EXTRA_TEXT, Html.fromHtml(message) );
|
||||
choiceID = R.string.invite_chooser_email;
|
||||
} else {
|
||||
intent.setAction( Intent.ACTION_VIEW );
|
||||
intent.setType( "vnd.android-dir/mms-sms" );
|
||||
intent.putExtra( "sms_body", message );
|
||||
choiceID = R.string.invite_chooser_sms;
|
||||
}
|
||||
|
||||
String chooserMsg = context.getString( R.string.invite_chooser );
|
||||
String choiceType = context.getString( choiceID );
|
||||
String chooserMsg =
|
||||
Utils.format( context, R.string.invite_chooserf, choiceType );
|
||||
context.startActivity( Intent.createChooser( intent, chooserMsg ) );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue