aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestedWords.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-06-30 08:52:04 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-30 08:52:04 -0700
commit7e7244873a1317ba898e498526b963f7d41caa86 (patch)
treea9a4c9914b5674ba2030a9a7c4f6daea8dc2ac96 /java/src/com/android/inputmethod/latin/SuggestedWords.java
parentbb15e77511a84483ccb6c4491b73c7f016878539 (diff)
parent74b6897a12ec603ef835aaa77a01f0c32f49aa1c (diff)
downloadlatinime-7e7244873a1317ba898e498526b963f7d41caa86.tar.gz
latinime-7e7244873a1317ba898e498526b963f7d41caa86.tar.xz
latinime-7e7244873a1317ba898e498526b963f7d41caa86.zip
Merge "Adaptive suggestions strip"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestedWords.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestedWords.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index a8cdfc02e..84db17504 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -24,15 +24,17 @@ import java.util.HashSet;
import java.util.List;
public class SuggestedWords {
- public static final SuggestedWords EMPTY = new SuggestedWords(null, false, false, null);
+ public static final SuggestedWords EMPTY = new SuggestedWords(null, false, false, false, null);
public final List<CharSequence> mWords;
public final boolean mTypedWordValid;
public final boolean mHasMinimalSuggestion;
+ public final boolean mIsPunctuationSuggestions;
public final List<SuggestedWordInfo> mSuggestedWordInfoList;
private SuggestedWords(List<CharSequence> words, boolean typedWordValid,
- boolean hasMinimalSuggestion, List<SuggestedWordInfo> suggestedWordInfoList) {
+ boolean hasMinimalSuggestion, boolean isPunctuationSuggestions,
+ List<SuggestedWordInfo> suggestedWordInfoList) {
if (words != null) {
mWords = words;
} else {
@@ -40,6 +42,7 @@ public class SuggestedWords {
}
mTypedWordValid = typedWordValid;
mHasMinimalSuggestion = hasMinimalSuggestion;
+ mIsPunctuationSuggestions = isPunctuationSuggestions;
mSuggestedWordInfoList = suggestedWordInfoList;
}
@@ -59,10 +62,15 @@ public class SuggestedWords {
return mHasMinimalSuggestion && ((size() > 1 && !mTypedWordValid) || mTypedWordValid);
}
+ public boolean isPunctuationSuggestions() {
+ return mIsPunctuationSuggestions;
+ }
+
public static class Builder {
private List<CharSequence> mWords = new ArrayList<CharSequence>();
private boolean mTypedWordValid;
private boolean mHasMinimalSuggestion;
+ private boolean mIsPunctuationSuggestions;
private List<SuggestedWordInfo> mSuggestedWordInfoList =
new ArrayList<SuggestedWordInfo>();
@@ -118,6 +126,11 @@ public class SuggestedWords {
return this;
}
+ public Builder setIsPunctuationSuggestions() {
+ mIsPunctuationSuggestions = true;
+ return this;
+ }
+
// Should get rid of the first one (what the user typed previously) from suggestions
// and replace it with what the user currently typed.
public Builder addTypedWordAndPreviousSuggestions(CharSequence typedWord,
@@ -143,7 +156,7 @@ public class SuggestedWords {
public SuggestedWords build() {
return new SuggestedWords(mWords, mTypedWordValid, mHasMinimalSuggestion,
- mSuggestedWordInfoList);
+ mIsPunctuationSuggestions, mSuggestedWordInfoList);
}
public int size() {