aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-12-16 13:52:30 +0900
committerJean Chalard <jchalard@google.com>2011-12-16 18:21:26 +0900
commit1ba17f97d51ad34e6d8015a22d6bc6afd3eeb321 (patch)
tree75c04ea6074871c14ab84b8bcc0e9619300a239f /java/src
parent4fc0f6ab029f7611c200692567ab1ed7aec1d017 (diff)
downloadlatinime-1ba17f97d51ad34e6d8015a22d6bc6afd3eeb321.tar.gz
latinime-1ba17f97d51ad34e6d8015a22d6bc6afd3eeb321.tar.xz
latinime-1ba17f97d51ad34e6d8015a22d6bc6afd3eeb321.zip
Small refactoring
This helps to make following changes smaller Change-Id: I95ba2901ac3bf1ed70a748c35a0babdd9af1df63
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index abe6dfb96..71db4550c 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -819,6 +819,14 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
+ " imeOptions=0x%08x",
inputType, editorInfo.imeOptions));
}
+ final boolean flagNoSuggestions =
+ 0 != (inputType & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
+ final boolean flagMultiLine =
+ 0 != (inputType & InputType.TYPE_TEXT_FLAG_MULTI_LINE);
+ final boolean flagAutoCorrect =
+ 0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT);
+ final boolean flagAutoComplete =
+ 0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
mApplicationSpecifiedCompletions = null;
@@ -845,22 +853,21 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
} else if (variation == InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT) {
// If it's a browser edit field and auto correct is not ON explicitly, then
// disable auto correction, but keep suggestions on.
- if ((inputType & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT) == 0) {
+ if (!flagAutoCorrect) {
inputTypeNoAutoCorrect = true;
}
}
// If NO_SUGGESTIONS is set, don't do prediction.
- if ((inputType & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) != 0) {
+ if (flagNoSuggestions) {
isSettingsSuggestionStripOn = false;
inputTypeNoAutoCorrect = true;
}
// If it's not multiline and the autoCorrect flag is not set, then don't correct
- if ((inputType & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT) == 0
- && (inputType & InputType.TYPE_TEXT_FLAG_MULTI_LINE) == 0) {
+ if (!flagAutoCorrect && !flagMultiLine) {
inputTypeNoAutoCorrect = true;
}
- if ((inputType & InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) {
+ if (flagAutoComplete) {
isSettingsSuggestionStripOn = false;
applicationSpecifiedCompletionOn = isFullscreenMode();
}