aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-24 18:07:20 +0900
committerJean Chalard <jchalard@google.com>2013-12-25 22:25:49 +0900
commit52a2682b99fc57dea974b21f3d606ed53a802e60 (patch)
treea5de4ba67550b4ab4d5d9ba8458ced02abbf6b8b /java/src
parent0154609a2e98e217e49e53253746608767a02241 (diff)
downloadlatinime-52a2682b99fc57dea974b21f3d606ed53a802e60.tar.gz
latinime-52a2682b99fc57dea974b21f3d606ed53a802e60.tar.xz
latinime-52a2682b99fc57dea974b21f3d606ed53a802e60.zip
[IL35] Preparative cleanup
Bug: 8636060 Change-Id: Id6791085816891c78289b0223bf0807db2da6300
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java18
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java9
2 files changed, 14 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 68ed23897..b84bba2c7 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1272,7 +1272,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onCancelBatchInput() {
- mInputLogic.onCancelBatchInput(mInputUpdater);
+ mInputLogic.onCancelBatchInput(mHandler, mInputUpdater);
}
// TODO[IL]: Make this a package-private standalone class in inputlogic/ and remove all
@@ -1310,17 +1310,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return true;
}
- // Run in the UI thread.
+ // Run on the UI thread.
public void onStartBatchInput() {
synchronized (mLock) {
mHandler.removeMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP);
mInBatchInput = true;
- mLatinIme.mHandler.showGesturePreviewAndSuggestionStrip(
- SuggestedWords.EMPTY, false /* dismissGestureFloatingPreviewText */);
}
}
- // Run in the Handler thread.
+ // Run on the Handler thread.
private void updateBatchInput(final InputPointers batchPointers, final int sequenceNumber) {
synchronized (mLock) {
if (!mInBatchInput) {
@@ -1339,7 +1337,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
- // Run in the UI thread.
+ // Run on the UI thread.
public void onUpdateBatchInput(final InputPointers batchPointers,
final int sequenceNumber) {
if (mHandler.hasMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP)) {
@@ -1352,12 +1350,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void onCancelBatchInput() {
synchronized (mLock) {
mInBatchInput = false;
- mLatinIme.mHandler.showGesturePreviewAndSuggestionStrip(
- SuggestedWords.EMPTY, true /* dismissGestureFloatingPreviewText */);
}
}
- // Run in the UI thread.
+ // Run on the UI thread.
public void onEndBatchInput(final InputPointers batchPointers) {
synchronized(mLock) {
getSuggestedWordsGestureLocked(batchPointers, SuggestedWords.NOT_A_SEQUENCE_NUMBER,
@@ -1407,7 +1403,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
- // This method must run in UI Thread.
+ // This method must run on the UI Thread.
private void showGesturePreviewAndSuggestionStrip(final SuggestedWords suggestedWords,
final boolean dismissGestureFloatingPreviewText) {
showSuggestionStrip(suggestedWords);
@@ -1418,7 +1414,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
- // This method must run in UI Thread.
+ // 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)) {
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 61d4bab13..4a4abd7d2 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -303,6 +303,8 @@ public final class InputLogic {
final KeyboardSwitcher keyboardSwitcher, final LatinIME.UIHandler handler,
final LatinIME.InputUpdater inputUpdater) {
inputUpdater.onStartBatchInput();
+ handler.showGesturePreviewAndSuggestionStrip(
+ SuggestedWords.EMPTY, false /* dismissGestureFloatingPreviewText */);
handler.cancelUpdateSuggestionStrip();
mConnection.beginBatchEdit();
if (mWordComposer.isComposingWord()) {
@@ -403,9 +405,12 @@ public final class InputLogic {
inputUpdater.onEndBatchInput(batchPointers);
}
- // TODO: remove this argument
- public void onCancelBatchInput(final LatinIME.InputUpdater inputUpdater) {
+ // TODO: remove these arguments
+ public void onCancelBatchInput(final LatinIME.UIHandler handler,
+ final LatinIME.InputUpdater inputUpdater) {
inputUpdater.onCancelBatchInput();
+ handler.showGesturePreviewAndSuggestionStrip(
+ SuggestedWords.EMPTY, true /* dismissGestureFloatingPreviewText */);
}
/**