aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-10-10 02:59:39 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-10 02:59:39 -0700
commit2ac4000d1f957a717242e5526c3a1eccc8e2e8d3 (patch)
tree2b24d45555fdf29761e99fd8ef70e5f3b7263cb7 /java/src/com/android/inputmethod/latin/LatinIME.java
parent01f7ed359531d2a9461168052bf2b09fa24f253c (diff)
parent602bcecf6bbe64080c602cd71e33f814551370f4 (diff)
downloadlatinime-2ac4000d1f957a717242e5526c3a1eccc8e2e8d3.tar.gz
latinime-2ac4000d1f957a717242e5526c3a1eccc8e2e8d3.tar.xz
latinime-2ac4000d1f957a717242e5526c3a1eccc8e2e8d3.zip
am 602bcecf: Merge "Put SuggestionSpan as the indicater of the auto-correction"
* commit '602bcecf6bbe64080c602cd71e33f814551370f4': 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() {