From 8ff27cc07592cd8dbbb462181e94da635518477c Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 24 Jun 2012 14:46:02 -0700 Subject: [PATCH] include "sms" or "text" in chooser title --- xwords4/android/XWords4/res/values/strings.xml | 8 +++++--- .../XWords4/src/org/eehouse/android/xw4/GameUtils.java | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 315870ef5..662a109c9 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -1197,11 +1197,11 @@ have Crosswords installed.) The first uses defaults; the second lets you change them before beginning the game. - Send invitation using SMS (texting) or - email? + via email? - Send invitation via + Send invitation via %s + email + sms diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java index 14342fba3..dd4821bee 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java @@ -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 ) ); } }