Loading java/res/values/donottranslate.xml +2 −0 Original line number Diff line number Diff line Loading @@ -140,10 +140,12 @@ <string-array name="subtype_locale_exception_keys"> <item>en_US</item> <item>en_GB</item> <item>es_US</item> </string-array> <string-array name="subtype_locale_exception_values"> <item>English (US)</item> <item>English (UK)</item> <item>Español (EE.UU.)</item> </string-array> <!-- Generic subtype label --> Loading java/res/xml/method.xml +12 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,8 @@ en_GB: English Great Britain/qwerty eo: Esperanto/spanish es: Spanish/spanish es_419: Spanish Latin America/qwerty es_US: Spanish United States/spanish (es_419: Spanish Latin America/qwerty) et: Estonian/nordic fa: Persian/arabic fi: Finnish/nordic Loading Loading @@ -184,13 +185,22 @@ android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="AsciiCapable,SupportTouchPositionCorrection" /> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" android:subtypeId="0x84d2efc6" android:imeSubtypeLocale="es_US" android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="KeyboardLayoutSet=spanish,AsciiCapable" /> <!-- <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" android:subtypeId="0x623f9286" android:imeSubtypeLocale="es_419" android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=spanish,AsciiCapable" /> --> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" android:subtypeId="0xec2d3955" Loading java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +13 −12 Original line number Diff line number Diff line Loading @@ -1030,9 +1030,10 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack // InputMethodSubtype's display name for spacebar text in its locale. // isAdditionalSubtype (T=true, F=false) // locale layout | Short Middle Full // ------ ------ - ---- --------- ---------------------- // ------ ------- - ---- --------- ---------------------- // en_US qwerty F En English English (US) exception // en_GB qwerty F En English English (UK) exception // es_US spanish F Es Español Español (EE.UU.) exception // fr azerty F Fr Français Français // fr_CA qwerty F Fr Français Français (Canada) // de qwertz F De Deutsch Deutsch Loading java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java +8 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,9 @@ public final class AdditionalSubtypeSettings extends PreferenceFragment { } static final class SubtypeLocaleAdapter extends ArrayAdapter<SubtypeLocaleItem> { private static final String TAG = SubtypeLocaleAdapter.class.getSimpleName(); private static final boolean DEBUG_SUBTYPE_ID = false; public SubtypeLocaleAdapter(final Context context) { super(context, android.R.layout.simple_spinner_item); setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); Loading @@ -97,6 +100,11 @@ public final class AdditionalSubtypeSettings extends PreferenceFragment { final int count = imi.getSubtypeCount(); for (int i = 0; i < count; i++) { final InputMethodSubtype subtype = imi.getSubtypeAt(i); if (DEBUG_SUBTYPE_ID) { android.util.Log.d(TAG, String.format("%-6s 0x%08x %11d %s", subtype.getLocale(), subtype.hashCode(), subtype.hashCode(), SubtypeLocale.getSubtypeDisplayName(subtype, context.getResources()))); } if (subtype.containsExtraValueKey(ASCII_CAPABLE)) { items.add(createItem(context, subtype.getLocale())); } Loading java/src/com/android/inputmethod/latin/RichInputMethodManager.java +24 −10 Original line number Diff line number Diff line Loading @@ -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; } } Loading Loading
java/res/values/donottranslate.xml +2 −0 Original line number Diff line number Diff line Loading @@ -140,10 +140,12 @@ <string-array name="subtype_locale_exception_keys"> <item>en_US</item> <item>en_GB</item> <item>es_US</item> </string-array> <string-array name="subtype_locale_exception_values"> <item>English (US)</item> <item>English (UK)</item> <item>Español (EE.UU.)</item> </string-array> <!-- Generic subtype label --> Loading
java/res/xml/method.xml +12 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,8 @@ en_GB: English Great Britain/qwerty eo: Esperanto/spanish es: Spanish/spanish es_419: Spanish Latin America/qwerty es_US: Spanish United States/spanish (es_419: Spanish Latin America/qwerty) et: Estonian/nordic fa: Persian/arabic fi: Finnish/nordic Loading Loading @@ -184,13 +185,22 @@ android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="AsciiCapable,SupportTouchPositionCorrection" /> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" android:subtypeId="0x84d2efc6" android:imeSubtypeLocale="es_US" android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="KeyboardLayoutSet=spanish,AsciiCapable" /> <!-- <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" android:subtypeId="0x623f9286" android:imeSubtypeLocale="es_419" android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=spanish,AsciiCapable" /> --> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" android:subtypeId="0xec2d3955" Loading
java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +13 −12 Original line number Diff line number Diff line Loading @@ -1030,9 +1030,10 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack // InputMethodSubtype's display name for spacebar text in its locale. // isAdditionalSubtype (T=true, F=false) // locale layout | Short Middle Full // ------ ------ - ---- --------- ---------------------- // ------ ------- - ---- --------- ---------------------- // en_US qwerty F En English English (US) exception // en_GB qwerty F En English English (UK) exception // es_US spanish F Es Español Español (EE.UU.) exception // fr azerty F Fr Français Français // fr_CA qwerty F Fr Français Français (Canada) // de qwertz F De Deutsch Deutsch Loading
java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java +8 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,9 @@ public final class AdditionalSubtypeSettings extends PreferenceFragment { } static final class SubtypeLocaleAdapter extends ArrayAdapter<SubtypeLocaleItem> { private static final String TAG = SubtypeLocaleAdapter.class.getSimpleName(); private static final boolean DEBUG_SUBTYPE_ID = false; public SubtypeLocaleAdapter(final Context context) { super(context, android.R.layout.simple_spinner_item); setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); Loading @@ -97,6 +100,11 @@ public final class AdditionalSubtypeSettings extends PreferenceFragment { final int count = imi.getSubtypeCount(); for (int i = 0; i < count; i++) { final InputMethodSubtype subtype = imi.getSubtypeAt(i); if (DEBUG_SUBTYPE_ID) { android.util.Log.d(TAG, String.format("%-6s 0x%08x %11d %s", subtype.getLocale(), subtype.hashCode(), subtype.hashCode(), SubtypeLocale.getSubtypeDisplayName(subtype, context.getResources()))); } if (subtype.containsExtraValueKey(ASCII_CAPABLE)) { items.add(createItem(context, subtype.getLocale())); } Loading
java/src/com/android/inputmethod/latin/RichInputMethodManager.java +24 −10 Original line number Diff line number Diff line Loading @@ -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; } } Loading