aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestedWords.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-10-06 15:23:07 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-06 15:23:07 +0000
commitc6e4acb1d246209b58b7fb7345a1261f75909e0b (patch)
tree8b49ea7efe91b8be8ac2d0bcb49d3fcd66c30504 /java/src/com/android/inputmethod/latin/SuggestedWords.java
parent7ac63288b274e03a5369e5ba45120efc4d2ef58d (diff)
parent6fb586a527e7ffe5da187c8b345cdf897b8481c7 (diff)
downloadlatinime-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.java13
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.