diff options
author | 2014-10-06 15:23:07 +0000 | |
---|---|---|
committer | 2014-10-06 15:23:07 +0000 | |
commit | c6e4acb1d246209b58b7fb7345a1261f75909e0b (patch) | |
tree | 8b49ea7efe91b8be8ac2d0bcb49d3fcd66c30504 /java/src/com/android/inputmethod/latin/SuggestedWords.java | |
parent | 7ac63288b274e03a5369e5ba45120efc4d2ef58d (diff) | |
parent | 6fb586a527e7ffe5da187c8b345cdf897b8481c7 (diff) | |
download | latinime-c6e4acb1d246209b58b7fb7345a1261f75909e0b.tar.gz latinime-c6e4acb1d246209b58b7fb7345a1261f75909e0b.tar.xz latinime-c6e4acb1d246209b58b7fb7345a1261f75909e0b.zip |
am 6fb586a5: Fix missing prediction words on contextual strip
* commit '6fb586a527e7ffe5da187c8b345cdf897b8481c7':
Fix missing prediction words on contextual strip
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestedWords.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/SuggestedWords.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index e6fd43a07..466576465 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -113,6 +113,19 @@ public class SuggestedWords { } /** + * Get suggested word to show as suggestions to UI. + * + * @param shouldShowLxxSuggestionUi true if showing suggestion UI introduced in LXX and later. + * @return the count of suggested word to show as suggestions to UI. + */ + public int getWordCountToShow(final boolean shouldShowLxxSuggestionUi) { + if (isPrediction() || !shouldShowLxxSuggestionUi) { + return size(); + } + return size() - /* typed word */ 1; + } + + /** * Get suggested word at <code>index</code>. * @param index The index of the suggested word. * @return The suggested word. |