aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2009-09-17 11:08:16 -0700
committerAmith Yamasani <yamasani@google.com>2009-09-17 11:10:15 -0700
commit36ebae2e8d58d36d3f8dd2f8a2d34c0c06522a8e (patch)
tree678cbed4e058c2579fa768232b169c6b217221a9 /src
parent3ec2ed75c6ac251a26d76324b17cdf6498bddb88 (diff)
downloadlatinime-36ebae2e8d58d36d3f8dd2f8a2d34c0c06522a8e.tar.gz
latinime-36ebae2e8d58d36d3f8dd2f8a2d34c0c06522a8e.tar.xz
latinime-36ebae2e8d58d36d3f8dd2f8a2d34c0c06522a8e.zip
Handle new flag NO_SUGGESTIONS and no auto-correct for single-line fields unless requested. Fix: 2030364
Don't show suggestions if NO_SUGGESTIONS flag is specified. And don't do auto-correction unless explicitly requested or it's a multi-line text.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/inputmethod/latin/LatinIME.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java
index 965656db2..bab12b91f 100644
--- a/src/com/android/inputmethod/latin/LatinIME.java
+++ b/src/com/android/inputmethod/latin/LatinIME.java
@@ -308,6 +308,17 @@ public class LatinIME extends InputMethodService
disableAutoCorrect = true;
}
}
+
+ // If NO_SUGGESTIONS is set, don't do prediction.
+ if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS) != 0) {
+ mPredictionOn = false;
+ disableAutoCorrect = true;
+ }
+ // If it's not multiline and the autoCorrect flag is not set, then don't correct
+ if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) == 0 &&
+ (attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE) == 0) {
+ disableAutoCorrect = true;
+ }
if ((attribute.inputType&EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) {
mPredictionOn = false;
mCompletionOn = true && isFullscreenMode();