From 12ba821bfb39f45a529959187e7fd7b950e9ef62 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 6 Jan 2014 12:10:05 +0900 Subject: [PATCH] Add description of disabled voice input key option Bug: 12377179 Change-Id: I44d35c6fa82883710674ecca6f630d09076472fe --- java/res/values/strings.xml | 2 ++ .../inputmethod/latin/settings/SettingsFragment.java | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index f618473bd..8e8a13f9b 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -249,6 +249,8 @@ Voice input key + + No voice input methods enabled. Check Language & input settings. Configure input methods diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java index e1182e4ff..67017a43b 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java @@ -238,8 +238,14 @@ public final class SettingsFragment extends InputMethodSettingsFragment super.onResume(); final SharedPreferences prefs = getPreferenceManager().getSharedPreferences(); final Resources res = getResources(); - final boolean isShortcutImeEnabled = SubtypeSwitcher.getInstance().isShortcutImeEnabled(); - setPreferenceEnabled(Settings.PREF_VOICE_INPUT_KEY, isShortcutImeEnabled); + final Preference voiceInputKeyOption = findPreference(Settings.PREF_VOICE_INPUT_KEY); + if (voiceInputKeyOption != null) { + final boolean isShortcutImeEnabled = SubtypeSwitcher.getInstance() + .isShortcutImeEnabled(); + voiceInputKeyOption.setEnabled(isShortcutImeEnabled); + voiceInputKeyOption.setSummary(isShortcutImeEnabled ? null + : res.getText(R.string.voice_input_disabled_summary)); + } final CheckBoxPreference showSetupWizardIcon = (CheckBoxPreference)findPreference(Settings.PREF_SHOW_SETUP_WIZARD_ICON); if (showSetupWizardIcon != null) {