aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-07-23 18:30:53 +0900
committerJean Chalard <jchalard@google.com>2012-07-23 18:32:13 +0900
commit491d451e382a8e7d42937a96e4e06ada483e57b5 (patch)
tree3e5bcc059698691c4a4745f0c3ac10c72f9ce109 /java/src
parent4702671ea4feb0c79a879e2e3013afdd6ed800b1 (diff)
downloadlatinime-491d451e382a8e7d42937a96e4e06ada483e57b5.tar.gz
latinime-491d451e382a8e7d42937a96e4e06ada483e57b5.tar.xz
latinime-491d451e382a8e7d42937a96e4e06ada483e57b5.zip
Fix a bug with the 'add to dict' hint popping up too much
Not having a main dictionary is not sufficient reason to display the hint. If the user already added the word to the dictionary then we shouldn't be displaying it again, even if we don't have a main dictionary for the current language. Bug: 6829798 Change-Id: I6b081f51c82ef395fe2e394fd3167363e743ea6f
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 2ad727e4b..b7066f3ab 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1883,18 +1883,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mKeyboardSwitcher.updateShiftState();
// We should show the "Touch again to save" hint if the user pressed the first entry
- // AND either:
- // - There is no dictionary (we know that because we tried to load it => null != mSuggest
- // AND mSuggest.hasMainDictionary() is false)
- // - There is a dictionary and the word is not in it
+ // AND it's in none of our current dictionaries (main, user or otherwise).
// Please note that if mSuggest is null, it means that everything is off: suggestion
// and correction, so we shouldn't try to show the hint
final boolean showingAddToDictionaryHint = index == 0 && mSuggest != null
- // If there is no dictionary the hint should be shown.
- && (!mSuggest.hasMainDictionary()
- // If "suggestion" is not in the dictionary, the hint should be shown.
- || !AutoCorrection.isValidWord(
- mSuggest.getUnigramDictionaries(), suggestion, true));
+ // If the suggestion is not in the dictionary, the hint should be shown.
+ && !AutoCorrection.isValidWord(mSuggest.getUnigramDictionaries(), suggestion, true);
Utils.Stats.onSeparator((char)Keyboard.CODE_SPACE, WordComposer.NOT_A_COORDINATE,
WordComposer.NOT_A_COORDINATE);