diff options
author | 2013-04-09 10:28:47 +0000 | |
---|---|---|
committer | 2013-04-09 10:28:47 +0000 | |
commit | 19dcd154932b8aef07f371bdda7f879a70c3c3c8 (patch) | |
tree | b1b13d6f5bc29a68fbde715464f10e6265e953d2 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | f31553bc09f83d21b9321a2c45a2213c28282408 (diff) | |
parent | 9310f42a36eabe99ed7dcd3b835d6cdaa3c6fdca (diff) | |
download | latinime-19dcd154932b8aef07f371bdda7f879a70c3c3c8.tar.gz latinime-19dcd154932b8aef07f371bdda7f879a70c3c3c8.tar.xz latinime-19dcd154932b8aef07f371bdda7f879a70c3c3c8.zip |
Merge "Offer to add any OOV typed word to the dictionary."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 3262a9a10..56b1c786e 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -72,6 +72,7 @@ import com.android.inputmethod.keyboard.KeyboardActionListener; import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.MainKeyboardView; +import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.Utils.Stats; import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.suggestions.SuggestionStripView; @@ -2173,8 +2174,9 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // Called from {@link SuggestionStripView} through the {@link SuggestionStripView#Listener} // interface @Override - public void pickSuggestionManually(final int index, final String suggestion) { + public void pickSuggestionManually(final int index, final SuggestedWordInfo suggestionInfo) { final SuggestedWords suggestedWords = mSuggestedWords; + final String suggestion = suggestionInfo.mWord; // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput if (suggestion.length() == 1 && isShowingPunctuationList()) { // Word separators are suggested before the user inputs something. @@ -2240,7 +2242,8 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // 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 + final boolean showingAddToDictionaryHint = + SuggestedWordInfo.KIND_TYPED == suggestionInfo.mKind && mSuggest != null // If the suggestion is not in the dictionary, the hint should be shown. && !AutoCorrection.isValidWord(mSuggest.getUnigramDictionaries(), suggestion, true); |