aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-10-10 02:58:22 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-10 02:58:22 -0700
commit602bcecf6bbe64080c602cd71e33f814551370f4 (patch)
tree2b24d45555fdf29761e99fd8ef70e5f3b7263cb7 /java/src/com/android/inputmethod/latin/LatinIME.java
parent7c2d7ad6349eaf36312b69feb6efb6cd7201b0bc (diff)
parentec780e2868962bf17f0dfd35d36895f543bde40a (diff)
downloadlatinime-602bcecf6bbe64080c602cd71e33f814551370f4.tar.gz
latinime-602bcecf6bbe64080c602cd71e33f814551370f4.tar.xz
latinime-602bcecf6bbe64080c602cd71e33f814551370f4.zip
Merge "Put SuggestionSpan as the indicater of the auto-correction"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java11
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 dfdb97b50..958092bc7 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1608,6 +1608,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() {