diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/res/xml-sw600dp/key_styles_common.xml | 1 | ||||
-rw-r--r-- | java/res/xml-sw768dp/key_styles_common.xml | 2 | ||||
-rw-r--r-- | java/res/xml/key_styles_common.xml | 3 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/SubtypeLocale.java | 17 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/UserHistoryDictionary.java | 2 |
5 files changed, 19 insertions, 6 deletions
diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index 9f16d1b17..dcaf45027 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -137,6 +137,7 @@ latin:styleName="toSymbolKeyStyle" latin:code="!code/key_switch_alpha_symbol" latin:keyLabel="!text/label_to_symbol_key" + latin:keyLabelFlags="preserveCase" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style diff --git a/java/res/xml-sw768dp/key_styles_common.xml b/java/res/xml-sw768dp/key_styles_common.xml index 2cae0d2ab..f2fb90bbc 100644 --- a/java/res/xml-sw768dp/key_styles_common.xml +++ b/java/res/xml-sw768dp/key_styles_common.xml @@ -136,7 +136,7 @@ latin:styleName="toSymbolKeyStyle" latin:code="!code/key_switch_alpha_symbol" latin:keyLabel="!text/label_to_symbol_key" - latin:keyLabelFlags="fontNormal" + latin:keyLabelFlags="fontNormal|preserveCase" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index 7981ab3a7..6b64985a6 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -165,7 +165,7 @@ latin:code="!code/key_switch_alpha_symbol" latin:keyIcon="!icon/shortcut_for_label" latin:keyLabel="!text/label_to_symbol_with_microphone_key" - latin:keyLabelFlags="withIconRight" + latin:keyLabelFlags="withIconRight|preserveCase" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> </case> @@ -174,6 +174,7 @@ latin:styleName="toSymbolKeyStyle" latin:code="!code/key_switch_alpha_symbol" latin:keyLabel="!text/label_to_symbol_key" + latin:keyLabelFlags="preserveCase" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> </default> diff --git a/java/src/com/android/inputmethod/latin/SubtypeLocale.java b/java/src/com/android/inputmethod/latin/SubtypeLocale.java index 9f89f9ee1..7694b56fc 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeLocale.java +++ b/java/src/com/android/inputmethod/latin/SubtypeLocale.java @@ -22,6 +22,8 @@ import android.content.Context; import android.content.res.Resources; import android.view.inputmethod.InputMethodSubtype; +import com.android.inputmethod.latin.LocaleUtils.RunInLocale; + import java.util.HashMap; import java.util.Locale; @@ -121,18 +123,27 @@ public class SubtypeLocale { // fr azerty F Français // fr_CA qwerty F Français (Canada) // de qwertz F Deutsch - // zz qwerty F No language (QWERTY) + // zz qwerty F No language (QWERTY) in system locale // fr qwertz T Français (QWERTZ) // de qwerty T Deutsch (QWERTY) // en_US azerty T English (US) (AZERTY) - // zz azerty T No language (AZERTY) + // zz azerty T No language (AZERTY) in system locale public static String getSubtypeDisplayName(InputMethodSubtype subtype, Resources res) { // TODO: Remove this check when InputMethodManager.getLastInputMethodSubtype is // fixed. if (!ImfUtils.checkIfSubtypeBelongsToThisIme(sContext, subtype)) return ""; final String language = getSubtypeLocaleDisplayName(subtype.getLocale()); - return res.getString(subtype.getNameResId(), language); + final int nameResId = subtype.getNameResId(); + final RunInLocale<String> getSubtypeName = new RunInLocale<String>() { + @Override + protected String job(Resources res) { + return res.getString(nameResId, language); + } + }; + final Locale locale = isNoLanguage(subtype) + ? res.getConfiguration().locale : getSubtypeLocale(subtype); + return getSubtypeName.runInLocale(res, locale); } public static boolean isNoLanguage(InputMethodSubtype subtype) { diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java index 62525c205..9191aa953 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java @@ -162,7 +162,7 @@ public class UserHistoryDictionary extends ExpandableDictionary { * Return whether the passed charsequence is in the dictionary. */ @Override - public boolean isValidWord(final CharSequence word) { + public synchronized boolean isValidWord(final CharSequence word) { // TODO: figure out what is the correct thing to do here. return false; } |