diff options
author | 2012-02-01 18:14:32 +0900 | |
---|---|---|
committer | 2012-02-01 19:33:26 +0900 | |
commit | ff858c7ff5e747c17ff6d9d1908e700ad30ded85 (patch) | |
tree | 75a001822ebd69e251574c48a08a1df08872dd43 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | a5c96f376ad57e78a88942bb618e067054ed818a (diff) | |
download | latinime-ff858c7ff5e747c17ff6d9d1908e700ad30ded85.tar.gz latinime-ff858c7ff5e747c17ff6d9d1908e700ad30ded85.tar.xz latinime-ff858c7ff5e747c17ff6d9d1908e700ad30ded85.zip |
Use MoreKeySpecParser to parse puctuations strip resources
This change also
* Doesn't use Key.getRtlParenthesisCode to get correct parentheses
code in RTL context. Intead uses the outputText feature of
moreKeys specification.
* Move CVS string parser from KeyStyles to Utils.
Bug: 5948247
Change-Id: I45752c7d01b4f7d3f3da900b110a2185b336a1f0
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index ef8fd1379..19cd16ad2 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -59,7 +59,6 @@ import com.android.inputmethod.compat.SuggestionSpanUtils; import com.android.inputmethod.compat.VibratorCompatWrapper; import com.android.inputmethod.deprecated.LanguageSwitcherProxy; import com.android.inputmethod.deprecated.VoiceProxy; -import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardActionListener; import com.android.inputmethod.keyboard.KeyboardId; @@ -1897,16 +1896,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // So, LatinImeLogger logs "" as a user's input. LatinImeLogger.logOnManualSuggestion( "", suggestion.toString(), index, suggestions.mWords); + final CharSequence outputText = mSettingsValues.mSuggestPuncOutputTextList + .getWord(index); + final int primaryCode = outputText.charAt(0); // Find out whether the previous character is a space. If it is, as a special case // for punctuation entered through the suggestion strip, it should be swapped // if it was a magic or a weak space. This is meant to help in case the user // pressed space on purpose of displaying the suggestion strip punctuation. - final int rawPrimaryCode = suggestion.charAt(0); - // Maybe apply the "bidi mirrored" conversions for parentheses - final Keyboard keyboard = mKeyboardSwitcher.getKeyboard(); - final boolean isRtl = keyboard != null && keyboard.mIsRtlKeyboard; - final int primaryCode = Key.getRtlParenthesisCode(rawPrimaryCode, isRtl); - insertPunctuationFromSuggestionStrip(ic, primaryCode); // TODO: the following endBatchEdit seems useless, check if (ic != null) { |