diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/res/xml/key_styles_currency.xml | 26 | ||||
-rw-r--r-- | java/res/xml/method.xml | 9 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionary.java | 24 |
3 files changed, 48 insertions, 11 deletions
diff --git a/java/res/xml/key_styles_currency.xml b/java/res/xml/key_styles_currency.xml index 29e2eae3d..0bb2bb408 100644 --- a/java/res/xml/key_styles_currency.xml +++ b/java/res/xml/key_styles_currency.xml @@ -129,6 +129,32 @@ latin:styleName="moreCurrency4KeyStyle" latin:keySpec="¢" /> </case> + <!-- IN: India (Rupee) --> + <case + latin:countryCode="IN" + > + <!-- U+20B9: "₹" INDIAN RUPEE SIGN + U+00A3: "£" POUND SIGN + U+20AC: "€" EURO SIGN + U+00A2: "¢" CENT SIGN --> + <key-style + latin:styleName="currencyKeyStyle" + latin:keySpec="₹" + latin:moreKeys="!text/morekeys_currency" /> + <key-style + latin:styleName="moreCurrency1KeyStyle" + latin:keySpec="£" /> + <key-style + latin:styleName="moreCurrency2KeyStyle" + latin:keySpec="€" /> + <key-style + latin:styleName="moreCurrency3KeyStyle" + latin:keySpec="$" + latin:moreKeys="¢" /> + <key-style + latin:styleName="moreCurrency4KeyStyle" + latin:keySpec="¢" /> + </case> <!-- GB: United Kingdom (Pound) --> <case latin:countryCode="GB" diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index 6db80b857..1bef3c254 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -34,6 +34,7 @@ de: German/qwertz de_CH: German (Switzerland)/swiss el: Greek/greek + en_IN: English (India)/qwerty en_US: English (United States)/qwerty en_GB: English (Great Britain)/qwerty eo: Esperanto/spanish @@ -217,6 +218,14 @@ /> <subtype android:icon="@drawable/ic_ime_switcher_dark" android:label="@string/subtype_generic" + android:subtypeId="0x8d58fc2d" + android:imeSubtypeLocale="en_IN" + android:imeSubtypeMode="keyboard" + android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable,EmojiCapable" + android:isAsciiCapable="true" + /> + <subtype android:icon="@drawable/ic_ime_switcher_dark" + android:label="@string/subtype_generic" android:subtypeId="0x4090554a" android:imeSubtypeLocale="eo" android:imeSubtypeMode="keyboard" diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 30c2dfedb..7b37777f5 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -253,18 +253,20 @@ public final class BinaryDictionary extends Dictionary { // TODO: toLowerCase in the native code final int[] prevWordCodePointArray = (null == prevWord) ? null : StringUtils.toCodePointArray(prevWord); - final int composerSize = composer.sizeWithoutTrailingSingleQuotes(); - + final InputPointers inputPointers = composer.getInputPointers(); final boolean isGesture = composer.isBatchMode(); - if (composerSize <= 1 || !isGesture) { + final int inputSize; + if (!isGesture) { + final int composerSize = composer.sizeWithoutTrailingSingleQuotes(); if (composerSize > MAX_WORD_LENGTH - 1) return null; for (int i = 0; i < composerSize; i++) { mInputCodePoints[i] = composer.getCodeAt(i); } + inputSize = composerSize; + } else { + inputSize = inputPointers.getPointerSize(); } - final InputPointers ips = composer.getInputPointers(); - final int inputSize = isGesture ? ips.getPointerSize() : composerSize; mNativeSuggestOptions.setIsGesture(isGesture); mNativeSuggestOptions.setAdditionalFeaturesOptions(additionalFeaturesOptions); if (inOutLanguageWeight != null) { @@ -274,12 +276,12 @@ public final class BinaryDictionary extends Dictionary { } // proximityInfo and/or prevWordForBigrams may not be null. getSuggestionsNative(mNativeDict, proximityInfo.getNativeProximityInfo(), - getTraverseSession(sessionId).getSession(), ips.getXCoordinates(), - ips.getYCoordinates(), ips.getTimes(), ips.getPointerIds(), mInputCodePoints, - inputSize, mNativeSuggestOptions.getOptions(), - prevWordCodePointArray, mOutputSuggestionCount, mOutputCodePoints, mOutputScores, - mSpaceIndices, mOutputTypes, mOutputAutoCommitFirstWordConfidence, - mInputOutputLanguageWeight); + getTraverseSession(sessionId).getSession(), inputPointers.getXCoordinates(), + inputPointers.getYCoordinates(), inputPointers.getTimes(), + inputPointers.getPointerIds(), mInputCodePoints, inputSize, + mNativeSuggestOptions.getOptions(), prevWordCodePointArray, mOutputSuggestionCount, + mOutputCodePoints, mOutputScores, mSpaceIndices, mOutputTypes, + mOutputAutoCommitFirstWordConfidence, mInputOutputLanguageWeight); if (inOutLanguageWeight != null) { inOutLanguageWeight[0] = mInputOutputLanguageWeight[0]; } |