aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-13 20:16:18 +0900
committerJean Chalard <jchalard@google.com>2012-03-13 20:19:21 +0900
commitec471c72f8da3aba9a2c57512e440a6f28fa7d9a (patch)
tree59cc8952da1cd4b302d0cab06718f0f6c15c4cda /java/src/com/android/inputmethod/latin/LatinIME.java
parent2e2519ee914d4bf9462950553840557a4c19faed (diff)
downloadlatinime-ec471c72f8da3aba9a2c57512e440a6f28fa7d9a.tar.gz
latinime-ec471c72f8da3aba9a2c57512e440a6f28fa7d9a.tar.xz
latinime-ec471c72f8da3aba9a2c57512e440a6f28fa7d9a.zip
Add to SuggestedWords a missing parameter, and use it.
Also stop using Builder between its creation and the call to the #build() method. Change-Id: Ie1fc3ec7b6f4c7c3789f672f4e26b4bf58c3e062
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index f41972e8b..def639dce 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1769,6 +1769,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// getSuggestedWordBuilder handles gracefully a null value of prevWord
final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(mWordComposer,
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode);
+ final SuggestedWords suggestions = builder.build();
// 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
@@ -1776,9 +1777,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// in most cases, suggestion count is 1 when typed word's length is 1, but we do always
// need to clear the previous state when the user starts typing a word (i.e. typed word's
// length == 1).
- if (builder.size() > 1 || typedWord.length() == 1 || !builder.allowsToBeAutoCorrected()
+ if (suggestions.size() > 1 || typedWord.length() == 1
+ || !suggestions.mAllowsToBeAutoCorrected
|| mSuggestionsView.isShowingAddToDictionaryHint()) {
- showSuggestions(builder.build(), typedWord);
+ showSuggestions(suggestions, typedWord);
} else {
SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions();
if (previousSuggestions == mSettingsValues.mSuggestPuncList) {