diff options
author | 2012-11-19 11:25:30 +0900 | |
---|---|---|
committer | 2012-11-19 15:39:44 +0900 | |
commit | 76d4ffeebfd084913a8c1b7433dff48f5b2063df (patch) | |
tree | 1e14d121b810a1447792e93eb5a5b3e58fb92c93 /java/src/com/android/inputmethod/latin/RichInputMethodManager.java | |
parent | 9904c9ebbddb04cb770fb9b4f891514851b07f93 (diff) | |
download | latinime-76d4ffeebfd084913a8c1b7433dff48f5b2063df.tar.gz latinime-76d4ffeebfd084913a8c1b7433dff48f5b2063df.tar.xz latinime-76d4ffeebfd084913a8c1b7433dff48f5b2063df.zip |
Add Spanish United States keyboard
The subtype locale name on the spacebar will be suppressed when only
one subtype is enabled and
- Subtype locale is equal to the system locale.
or
- Subtype language is equal to the system language but the subtype is
implicitly enabled.
Thus the "es_ES" system locale chooses "es" subtype keyboard
implicitly but the keyboard doesn't have the subtype name on its
spacebar.
This change also removes Spanish Latin America keyboard.
Bug: 7531804
Change-Id: Ib929e8235d643c0ba039eb010e18ab721a734e15
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputMethodManager.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputMethodManager.java | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java index b3832303d..63dfd3250 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java @@ -96,28 +96,42 @@ public final class RichInputMethodManager { return mInputMethodInfoOfThisIme.getId(); } - public boolean checkIfSubtypeBelongsToThisImeAndEnabled(final InputMethodSubtype ims) { - return checkIfSubtypeBelongsToImeAndEnabled(mInputMethodInfoOfThisIme, ims); + public boolean checkIfSubtypeBelongsToThisImeAndEnabled(final InputMethodSubtype subtype) { + return checkIfSubtypeBelongsToImeAndEnabled(mInputMethodInfoOfThisIme, subtype); + } + + public boolean checkIfSubtypeBelongsToThisImeAndImplicitlyEnabled( + final InputMethodSubtype subtype) { + final boolean subtypeEnabled = checkIfSubtypeBelongsToThisImeAndEnabled(subtype); + final boolean subtypeExplicitlyEnabled = checkIfSubtypeBelongsToList( + subtype, mImmWrapper.mImm.getEnabledInputMethodSubtypeList( + mInputMethodInfoOfThisIme, false /* allowsImplicitlySelectedSubtypes */)); + return subtypeEnabled && !subtypeExplicitlyEnabled; } public boolean checkIfSubtypeBelongsToImeAndEnabled(final InputMethodInfo imi, - final InputMethodSubtype ims) { - final List<InputMethodSubtype> subtypes = mImmWrapper.mImm.getEnabledInputMethodSubtypeList( - imi, true /* allowsImplicitlySelectedSubtypes */); - for (final InputMethodSubtype subtype : subtypes) { - if (subtype.equals(ims)) { + final InputMethodSubtype subtype) { + return checkIfSubtypeBelongsToList( + subtype, mImmWrapper.mImm.getEnabledInputMethodSubtypeList( + imi, true /* allowsImplicitlySelectedSubtypes */)); + } + + private static boolean checkIfSubtypeBelongsToList(final InputMethodSubtype subtype, + final List<InputMethodSubtype> subtypes) { + for (final InputMethodSubtype ims : subtypes) { + if (ims.equals(subtype)) { return true; } } return false; } - public boolean checkIfSubtypeBelongsToThisIme(final InputMethodSubtype ims) { + public boolean checkIfSubtypeBelongsToThisIme(final InputMethodSubtype subtype) { final InputMethodInfo myImi = mInputMethodInfoOfThisIme; final int count = myImi.getSubtypeCount(); for (int i = 0; i < count; i++) { - final InputMethodSubtype subtype = myImi.getSubtypeAt(i); - if (subtype.equals(ims)) { + final InputMethodSubtype ims = myImi.getSubtypeAt(i); + if (ims.equals(subtype)) { return true; } } |