aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-08-26 12:47:04 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-26 12:47:04 +0000
commitebf4a3e792d7be031f3304656aca46feb38c6a99 (patch)
treec737ea621e98402841f44ea8d041073c95954770 /java/src/com/android/inputmethod/latin/Suggest.java
parente4fb843a7fe4c8720f4ae4dd49086e9c6e239c28 (diff)
parent96522da9eb584c173083af677f47cdbc35d81436 (diff)
downloadlatinime-ebf4a3e792d7be031f3304656aca46feb38c6a99.tar.gz
latinime-ebf4a3e792d7be031f3304656aca46feb38c6a99.tar.xz
latinime-ebf4a3e792d7be031f3304656aca46feb38c6a99.zip
am 96522da9: am 2a2d324e: am 8380f921: Fix a bug where the top prediction would disappear.
* commit '96522da9eb584c173083af677f47cdbc35d81436': Fix a bug where the top prediction would disappear.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index ab852f8dd..6779351fd 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -120,9 +120,9 @@ public final class Suggest {
// and calls the callback function with the suggestions.
private void getSuggestedWordsForNonBatchInput(final WordComposer wordComposer,
final PrevWordsInfo prevWordsInfo, final ProximityInfo proximityInfo,
- final SettingsValuesForSuggestion settingsValuesForSuggestion, final int inputStyle,
- final boolean isCorrectionEnabled, final int sequenceNumber,
- final OnGetSuggestedWordsCallback callback) {
+ final SettingsValuesForSuggestion settingsValuesForSuggestion,
+ final int inputStyleIfNotPrediction, final boolean isCorrectionEnabled,
+ final int sequenceNumber, final OnGetSuggestedWordsCallback callback) {
final String typedWord = wordComposer.getTypedWord();
final int trailingSingleQuotesCount = StringUtils.getTrailingSingleQuotesCount(typedWord);
final String consideredWord = trailingSingleQuotesCount > 0
@@ -186,6 +186,8 @@ public final class Suggest {
suggestionsList = suggestionsContainer;
}
+ final int inputStyle = resultsArePredictions ? SuggestedWords.INPUT_STYLE_PREDICTION :
+ inputStyleIfNotPrediction;
callback.onGetSuggestedWords(new SuggestedWords(suggestionsList,
suggestionResults.mRawSuggestions,
// TODO: this first argument is lying. If this is a whitelisted word which is an
@@ -193,8 +195,7 @@ public final class Suggest {
// rename the attribute or change the value.
!resultsArePredictions && !allowsToBeAutoCorrected /* typedWordValid */,
hasAutoCorrection /* willAutoCorrect */,
- false /* isObsoleteSuggestions */, resultsArePredictions,
- inputStyle, sequenceNumber));
+ false /* isObsoleteSuggestions */, inputStyle, sequenceNumber));
}
// Retrieves suggestions for the batch input
@@ -244,7 +245,6 @@ public final class Suggest {
true /* typedWordValid */,
false /* willAutoCorrect */,
false /* isObsoleteSuggestions */,
- false /* isPrediction */,
inputStyle, sequenceNumber));
}