diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2013-01-10 11:31:47 +0900 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2013-01-10 16:25:05 +0900 |
| commit | 50d902ac6fd018131bd7044dd968bb99e0fdba7b (patch) | |
| tree | 528ea7130453b4d16e55bfda5531b86f38cde33d /java/src/com/android/inputmethod/keyboard/KeyboardView.java | |
| parent | 6512cd289d4d6bcc835b9da013c3098bf3807bc2 (diff) | |
Show final suggested word when batch input is finished
This change moves dismiss timer of gesture floating preview text from
PreviewPlacerView to KeyboardView.
Bug: 7967461
Change-Id: I0ca5beddc93cb4bc4a405f914d217d37b997402b
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/KeyboardView.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardView.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 63b9ed666..b7584d4cd 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -153,6 +153,10 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy, private boolean mShowKeyPreviewPopup = true; private int mKeyPreviewLingerTimeout; + // Gesture floating preview text + // TODO: Make this parameter customizable by user via settings. + private int mGestureFloatingPreviewTextLingerTimeout; + // Background state set private static final int[][][] KEY_PREVIEW_BACKGROUND_STATE_TABLE = { { // STATE_MIDDLE @@ -204,6 +208,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy, public static class DrawingHandler extends StaticInnerHandlerWrapper<KeyboardView> { private static final int MSG_DISMISS_KEY_PREVIEW = 0; + private static final int MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT = 1; public DrawingHandler(final KeyboardView outerInstance) { super(outerInstance); @@ -221,6 +226,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy, previewText.setVisibility(INVISIBLE); } break; + case MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT: + keyboardView.mPreviewPlacerView.setGestureFloatingPreviewText(SuggestedWords.EMPTY); + break; } } @@ -236,6 +244,10 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy, removeMessages(MSG_DISMISS_KEY_PREVIEW); } + public void dismissGestureFloatingPreviewText(final long delay) { + sendMessageDelayed(obtainMessage(MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT), delay); + } + public void cancelAllMessages() { cancelAllDismissKeyPreviews(); } @@ -279,6 +291,8 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy, R.styleable.KeyboardView_moreKeysLayout, 0); mBackgroundDimAlpha = keyboardViewAttr.getInt( R.styleable.KeyboardView_backgroundDimAlpha, 0); + mGestureFloatingPreviewTextLingerTimeout = keyboardViewAttr.getInt( + R.styleable.KeyboardView_gestureFloatingPreviewTextLingerTimeout, 0); keyboardViewAttr.recycle(); final TypedArray keyAttr = context.obtainStyledAttributes(attrs, @@ -877,7 +891,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy, public void dismissGestureFloatingPreviewText() { locatePreviewPlacerView(); - mPreviewPlacerView.dismissGestureFloatingPreviewText(); + mDrawingHandler.dismissGestureFloatingPreviewText(mGestureFloatingPreviewTextLingerTimeout); } @Override |
