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 17:20:10 +0900
committerTadashi G. Takaoka <takaoka@google.com>2014-10-07 00:06:53 +0900
commit6fb586a527e7ffe5da187c8b345cdf897b8481c7 (patch)
tree6953712f3b0e6130fb60a937a5decd0e35f65363 /java/src/com/android/inputmethod/latin/SuggestedWords.java
parentdb6c32778e80acc156a118f13ff2788a9277da30 (diff)
downloadlatinime-6fb586a527e7ffe5da187c8b345cdf897b8481c7.tar.gz
latinime-6fb586a527e7ffe5da187c8b345cdf897b8481c7.tar.xz
latinime-6fb586a527e7ffe5da187c8b345cdf897b8481c7.zip
Fix missing prediction words on contextual strip
Bug: 17874801 Change-Id: Iaba935a6b2548376f10a0ecd80f07ea7ada6c60a
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.