diff options
author | 2014-09-18 10:11:11 +0000 | |
---|---|---|
committer | 2014-09-18 10:11:11 +0000 | |
commit | 3d54f42511fedb5bb9e68815a2ae8c8c0275def0 (patch) | |
tree | ed1544546eb8f01842a613cc86ce7b28339ed728 /java/src/com/android/inputmethod/latin/SuggestedWords.java | |
parent | 40ba31a9cc865b665bd16a67cbdbd76fffba887b (diff) | |
parent | 0055d26164745b24b83d1cbda6d1b1a1acb36342 (diff) | |
download | latinime-3d54f42511fedb5bb9e68815a2ae8c8c0275def0.tar.gz latinime-3d54f42511fedb5bb9e68815a2ae8c8c0275def0.tar.xz latinime-3d54f42511fedb5bb9e68815a2ae8c8c0275def0.zip |
am 0055d261: Merge "Fix showing important notice even at beginning of sentence"
* commit '0055d26164745b24b83d1cbda6d1b1a1acb36342':
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.java | 14 |
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 dcfaa3f6d..3eefafc1f 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, @@ -180,6 +180,7 @@ public class SuggestedWords { return "SuggestedWords:" + " mTypedWordValid=" + mTypedWordValid + " mWillAutoCorrect=" + mWillAutoCorrect + + " mInputStyle=" + mInputStyle + " words=" + Arrays.toString(mSuggestedWordInfoList.toArray()); } @@ -386,8 +387,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 |