aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-27 08:06:48 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-12-27 08:06:48 +0000
commitd05ea8bd829da4110e86c38629fba94b4f560033 (patch)
tree5f45cb7c7f925a181a7da8796941054b5209c14c /java/src/com/android/inputmethod/latin/LatinIME.java
parentaf26a44102c004844546cb8d049aa43b629f3598 (diff)
parentc654fe57b1686dde764ea31b0e510885b75b14a1 (diff)
downloadlatinime-d05ea8bd829da4110e86c38629fba94b4f560033.tar.gz
latinime-d05ea8bd829da4110e86c38629fba94b4f560033.tar.xz
latinime-d05ea8bd829da4110e86c38629fba94b4f560033.zip
Merge "[IL48] Move onEndBatchInputAsyncInternal to InputLogic."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java37
1 files changed, 2 insertions, 35 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 354856320..03e92d5ee 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -216,7 +216,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
postUpdateSuggestionStrip();
break;
case MSG_ON_END_BATCH_INPUT:
- latinIme.onEndBatchInputAsyncInternal((SuggestedWords) msg.obj);
+ latinIme.mInputLogic.onEndBatchInputAsyncInternal(latinIme.mSettings.getCurrent(),
+ (SuggestedWords) msg.obj, latinIme.mKeyboardSwitcher);
break;
case MSG_RESET_CACHES:
latinIme.mInputLogic.retryResetCaches(latinIme.mSettings.getCurrent(),
@@ -1435,40 +1436,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
- // This method must run on the UI Thread.
- public void onEndBatchInputAsyncInternal(final SuggestedWords suggestedWords) {
- final String batchInputText = suggestedWords.isEmpty() ? null : suggestedWords.getWord(0);
- if (TextUtils.isEmpty(batchInputText)) {
- return;
- }
- mInputLogic.mConnection.beginBatchEdit();
- if (SpaceState.PHANTOM == mInputLogic.mSpaceState) {
- mInputLogic.promotePhantomSpace(mSettings.getCurrent());
- }
- if (mSettings.getCurrent().mPhraseGestureEnabled) {
- // Find the last space
- final int indexOfLastSpace = batchInputText.lastIndexOf(Constants.CODE_SPACE) + 1;
- if (0 != indexOfLastSpace) {
- mInputLogic.mConnection.commitText(batchInputText.substring(0, indexOfLastSpace),
- 1);
- showSuggestionStrip(suggestedWords.getSuggestedWordsForLastWordOfPhraseGesture());
- }
- final String lastWord = batchInputText.substring(indexOfLastSpace);
- mInputLogic.mWordComposer.setBatchInputWord(lastWord);
- mInputLogic.mConnection.setComposingText(lastWord, 1);
- } else {
- mInputLogic.mWordComposer.setBatchInputWord(batchInputText);
- mInputLogic.mConnection.setComposingText(batchInputText, 1);
- }
- mInputLogic.mConnection.endBatchEdit();
- if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
- ResearchLogger.latinIME_onEndBatchInput(batchInputText, 0, suggestedWords);
- }
- // Space state must be updated before calling updateShiftState
- mInputLogic.mSpaceState = SpaceState.PHANTOM;
- mKeyboardSwitcher.updateShiftState();
- }
-
// Called from PointerTracker through the KeyboardActionListener interface
@Override
public void onFinishSlidingInput() {