From 284f44b36496f3db6c531ab836d03e956be4d02a Mon Sep 17 00:00:00 2001 From: Elad Keyshawn Date: Tue, 7 Jun 2016 01:28:57 +0300 Subject: [PATCH] Speech to text dialog displays custom app name --- res/values/strings.xml | 2 +- src/org/kiwix/kiwixmobile/SearchActivity.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 62c58fc06..9b644f83d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -87,6 +87,6 @@ Extras Article opened in new tab Search Kiwix - Speak to search Kiwix + Speak to search %s Sorry! Your device does not support speech input \ No newline at end of file diff --git a/src/org/kiwix/kiwixmobile/SearchActivity.java b/src/org/kiwix/kiwixmobile/SearchActivity.java index 9f261e552..70492527e 100644 --- a/src/org/kiwix/kiwixmobile/SearchActivity.java +++ b/src/org/kiwix/kiwixmobile/SearchActivity.java @@ -173,12 +173,13 @@ public class SearchActivity extends AppCompatActivity private void promptSpeechInput() { + String appName = getResources().getString(R.string.app_name); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); // TODO: choose selected lang on kiwix intent.putExtra(RecognizerIntent.EXTRA_PROMPT, - getString(R.string.speech_prompt_text)); + String.format(getString(R.string.speech_prompt_text), appName)); try { startActivityForResult(intent, REQ_CODE_SPEECH_INPUT); } catch (ActivityNotFoundException a) {