aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-07-10 00:47:10 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-07-10 00:47:10 -0700
commit29540b25f060b92f4fbb3b273c9ef7bb5da5ee8e (patch)
treed981fb319f862e18c3a3ff03b9fc97a9ee33a174 /java/src
parent74620f449ef73eb929f926778a32a595796d0622 (diff)
parent09fdd30e5261990ace636c52a8330d4c5dbb364b (diff)
downloadlatinime-29540b25f060b92f4fbb3b273c9ef7bb5da5ee8e.tar.gz
latinime-29540b25f060b92f4fbb3b273c9ef7bb5da5ee8e.tar.xz
latinime-29540b25f060b92f4fbb3b273c9ef7bb5da5ee8e.zip
Merge "Simplification (A78)"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 7b4aedeb6..f30a75b6b 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1702,13 +1702,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private SuggestedWords maybeRetrieveOlderSuggestions(final CharSequence typedWord,
final SuggestedWords suggestedWords) {
// TODO: consolidate this into getSuggestedWords
- // 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
- // is 1 or typed word is found in dictionary, regardless of suggestion count. Actually,
- // 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 (suggestedWords.size() > 1 || typedWord.length() == 1 || !mWordComposer.isComposingWord()
+ // We update the suggestion strip only when we have some suggestions to show, i.e. when
+ // the suggestion count is > 1; else, we leave the old suggestions, with the typed word
+ // replaced with the new one. However, when the word is a dictionary word, or when the
+ // length of the typed word is 1 or 0 (after a deletion typically), we do want to remove the
+ // old suggestions. Also, if we are showing the "add to dictionary" hint, we need to
+ // revert to suggestions - although it is unclear how we can come here if it's displayed.
+ if (suggestedWords.size() > 1 || typedWord.length() <= 1
|| !suggestedWords.mTypedWordValid
|| mSuggestionsView.isShowingAddToDictionaryHint()) {
return suggestedWords;