aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-08-14 18:03:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-14 18:03:11 +0000
commite04c8b10d7876effbfdf2340a1fec6bf368c3409 (patch)
treea7e7002b213b07b5381e9cbd24bd99ee4113e010 /java/src/com/android/inputmethod/latin/LatinIME.java
parent1901c331283e2f60e6277a7773a103a447bd31ca (diff)
parentb8d764772b174cbd37354ffd0009bda56f223dc4 (diff)
downloadlatinime-e04c8b10d7876effbfdf2340a1fec6bf368c3409.tar.gz
latinime-e04c8b10d7876effbfdf2340a1fec6bf368c3409.tar.xz
latinime-e04c8b10d7876effbfdf2340a1fec6bf368c3409.zip
am b8d76477: Add the input style to SuggestedWords.
* commit 'b8d764772b174cbd37354ffd0009bda56f223dc4': Add the input style to SuggestedWords.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java27
1 files changed, 19 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 2cf7a04c1..71fd10e83 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -138,7 +138,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
new Runnable() {
@Override
public void run() {
- mHandler.postUpdateSuggestionStrip();
+ mHandler.postUpdateSuggestionStrip(SuggestedWords.INPUT_STYLE_NONE);
}
});
private final InputLogic mInputLogic = new InputLogic(this /* LatinIME */,
@@ -220,7 +220,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
case MSG_UPDATE_SUGGESTION_STRIP:
cancelUpdateSuggestionStrip();
latinIme.mInputLogic.performUpdateSuggestionStripSync(
- latinIme.mSettings.getCurrent());
+ latinIme.mSettings.getCurrent(), msg.arg1 /* inputStyle */);
break;
case MSG_UPDATE_SHIFT_STATE:
switcher.requestUpdatingShiftState(latinIme.getCurrentAutoCapsState(),
@@ -270,8 +270,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
- public void postUpdateSuggestionStrip() {
- sendMessageDelayed(obtainMessage(MSG_UPDATE_SUGGESTION_STRIP), mDelayUpdateSuggestions);
+ public void postUpdateSuggestionStrip(final int inputStyle) {
+ sendMessageDelayed(obtainMessage(MSG_UPDATE_SUGGESTION_STRIP, inputStyle,
+ 0 /* ignored */), mDelayUpdateSuggestions);
}
public void postReopenDictionaries() {
@@ -1060,7 +1061,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
applicationSpecifiedCompletions);
final SuggestedWords suggestedWords = new SuggestedWords(applicationSuggestedWords,
null /* rawSuggestions */, false /* typedWordValid */, false /* willAutoCorrect */,
- false /* isObsoleteSuggestions */, false /* isPrediction */);
+ false /* isObsoleteSuggestions */, false /* isPrediction */,
+ SuggestedWords.INPUT_STYLE_APPLICATION_SPECIFIED /* inputStyle */);
// When in fullscreen mode, show completions generated by the application forcibly
setSuggestedWords(suggestedWords);
}
@@ -1451,7 +1453,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
// TODO[IL]: Move this out of LatinIME.
- public void getSuggestedWords(final int sessionId, final int sequenceNumber,
+ public void getSuggestedWords(final int inputStyle, final int sequenceNumber,
final OnGetSuggestedWordsCallback callback) {
final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
if (keyboard == null) {
@@ -1459,7 +1461,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
}
mInputLogic.getSuggestedWords(mSettings.getCurrent(), keyboard.getProximityInfo(),
- mKeyboardSwitcher.getKeyboardShiftMode(), sessionId, sequenceNumber, callback);
+ mKeyboardSwitcher.getKeyboardShiftMode(), inputStyle, sequenceNumber, callback);
}
@Override
@@ -1543,7 +1545,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
default: // SHIFT_NO_UPDATE
}
if (inputTransaction.requiresUpdateSuggestions()) {
- mHandler.postUpdateSuggestionStrip();
+ final int inputStyle;
+ if (inputTransaction.mEvent.isSuggestionStripPress()) {
+ // Suggestion strip press: no input.
+ inputStyle = SuggestedWords.INPUT_STYLE_NONE;
+ } else if (inputTransaction.mEvent.isGesture()) {
+ inputStyle = SuggestedWords.INPUT_STYLE_TAIL_BATCH;
+ } else {
+ inputStyle = SuggestedWords.INPUT_STYLE_TYPING;
+ }
+ mHandler.postUpdateSuggestionStrip(inputStyle);
}
if (inputTransaction.didAffectContents()) {
mSubtypeState.setCurrentSubtypeHasBeenUsed();