aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-07-06 14:52:22 +0900
committerJean Chalard <jchalard@google.com>2012-07-09 15:06:16 +0900
commite4498929b070cdd673c69450e316e2932e334fd5 (patch)
tree2b70e2b83d8c61f3b8a4aa2d756ddcd561a94f08 /java/src/com/android/inputmethod
parentd579f1aefc8d02254db297ffd6d8f9dbdcab0637 (diff)
downloadlatinime-e4498929b070cdd673c69450e316e2932e334fd5.tar.gz
latinime-e4498929b070cdd673c69450e316e2932e334fd5.tar.xz
latinime-e4498929b070cdd673c69450e316e2932e334fd5.zip
Simple refactoring (A75)
Change-Id: Id19efc5d279616da52667fa70326b86aba70d4a0
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index ae0923182..4be2a1799 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1676,11 +1676,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final String typedWord = mWordComposer.getTypedWord();
final SuggestedWords suggestions;
+ if (!mWordComposer.isComposingWord() && !mCurrentSettings.mBigramPredictionEnabled) {
+ setPunctuationSuggestions();
+ return;
+ }
+
if (!mWordComposer.isComposingWord()) {
- if (!mCurrentSettings.mBigramPredictionEnabled) {
- setPunctuationSuggestions();
- return;
- }
suggestions = updateBigramPredictions();
} else {
suggestions = updateSuggestions(typedWord);
@@ -1700,7 +1701,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// getSuggestedWords handles gracefully a null value of prevWord
final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer,
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),
- mCurrentSettings.mCorrectionEnabled, false);
+ // !mWordComposer.isComposingWord() is known to be false
+ mCurrentSettings.mCorrectionEnabled, !mWordComposer.isComposingWord());
// Basically, we update the suggestion strip only when suggestion count > 1. However,
// there is an exception: We update the suggestion strip whenever typed word's length
@@ -1894,7 +1896,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators, 1);
return mSuggest.getSuggestedWords(mWordComposer,
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),
- mCurrentSettings.mCorrectionEnabled, true);
+ // !mWordComposer.isComposingWord() is known to be true
+ mCurrentSettings.mCorrectionEnabled, !mWordComposer.isComposingWord());
}
public void setPunctuationSuggestions() {