diff options
author | 2011-09-28 15:59:11 +0900 | |
---|---|---|
committer | 2011-10-10 18:44:52 +0900 | |
commit | ec780e2868962bf17f0dfd35d36895f543bde40a (patch) | |
tree | 50322687e3bd2c01d236fe205ca063819b78eae3 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | ce9e4f926b69745834df677501e59c6db3744de4 (diff) | |
download | latinime-ec780e2868962bf17f0dfd35d36895f543bde40a.tar.gz latinime-ec780e2868962bf17f0dfd35d36895f543bde40a.tar.xz latinime-ec780e2868962bf17f0dfd35d36895f543bde40a.zip |
Put SuggestionSpan as the indicater of the auto-correction
Bug: 5245468
Change-Id: Ia5609e1b3c69f5553e3632fbce60a55665a5b185
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 36e97af11..c5f336b3f 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1601,6 +1601,17 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mKeyboardSwitcher.onAutoCorrectionStateChanged( words.hasWordAboveAutoCorrectionScoreThreshold()); } + + // Put a blue underline to a word in TextView which will be auto-corrected. + final InputConnection ic = getCurrentInputConnection(); + if (ic != null && Utils.willAutoCorrect(words)) { + final CharSequence textWithUnderline = + SuggestionSpanUtils.getTextWithAutoCorrectionIndicatorUnderline( + this, mComposingStringBuilder); + if (!TextUtils.isEmpty(textWithUnderline)) { + ic.setComposingText(textWithUnderline, 1); + } + } } public void updateSuggestions() { |