diff options
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() { |