aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestedWords.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-09-19 08:39:12 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-19 08:39:12 +0000
commitfb92b7b427f0be52e1144b2daf8252d653059d6c (patch)
treebbcec41f8fbabaa9a1b793ba3d309ffd3dfdc3f3 /java/src/com/android/inputmethod/latin/SuggestedWords.java
parent1b25b575de1112e584a1734ccfacedf01fe321d4 (diff)
parentbf6977b97e19c864ca34011150c8e3ac64fabce3 (diff)
downloadlatinime-fb92b7b427f0be52e1144b2daf8252d653059d6c.tar.gz
latinime-fb92b7b427f0be52e1144b2daf8252d653059d6c.tar.xz
latinime-fb92b7b427f0be52e1144b2daf8252d653059d6c.zip
am bf6977b9: am bd46e3f2: am 00e01837: Merge "(DO NOT MERGE) Fix showing important notice even at beginning of sentence" into lmp-dev
* commit 'bf6977b97e19c864ca34011150c8e3ac64fabce3': (DO NOT MERGE) Fix showing important notice even at beginning of sentence
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestedWords.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestedWords.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index 6bc3da885..1d221b77f 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -39,6 +39,7 @@ public class SuggestedWords {
public static final int INPUT_STYLE_APPLICATION_SPECIFIED = 4;
public static final int INPUT_STYLE_RECORRECTION = 5;
public static final int INPUT_STYLE_PREDICTION = 6;
+ public static final int INPUT_STYLE_BEGINNING_OF_SENTENCE_PREDICTION = 7;
// The maximum number of suggestions available.
public static final int MAX_SUGGESTIONS = 18;
@@ -80,10 +81,9 @@ public class SuggestedWords {
final int inputStyle,
final int sequenceNumber) {
this(suggestedWordInfoList, rawSuggestions,
- (suggestedWordInfoList.isEmpty() || INPUT_STYLE_PREDICTION == inputStyle) ? null
+ (suggestedWordInfoList.isEmpty() || isPrediction(inputStyle)) ? null
: suggestedWordInfoList.get(INDEX_OF_TYPED_WORD).mWord,
- typedWordValid, willAutoCorrect, isObsoleteSuggestions, inputStyle,
- sequenceNumber);
+ typedWordValid, willAutoCorrect, isObsoleteSuggestions, inputStyle, sequenceNumber);
}
public SuggestedWords(final ArrayList<SuggestedWordInfo> suggestedWordInfoList,
@@ -171,6 +171,7 @@ public class SuggestedWords {
return "SuggestedWords:"
+ " mTypedWordValid=" + mTypedWordValid
+ " mWillAutoCorrect=" + mWillAutoCorrect
+ + " mInputStyle=" + mInputStyle
+ " words=" + Arrays.toString(mSuggestedWordInfoList.toArray());
}
@@ -377,8 +378,13 @@ public class SuggestedWords {
}
}
+ private static boolean isPrediction(final int inputStyle) {
+ return INPUT_STYLE_PREDICTION == inputStyle
+ || INPUT_STYLE_BEGINNING_OF_SENTENCE_PREDICTION == inputStyle;
+ }
+
public boolean isPrediction() {
- return INPUT_STYLE_PREDICTION == mInputStyle;
+ return isPrediction(mInputStyle);
}
// SuggestedWords is an immutable object, as much as possible. We must not just remove