From 08d8a676c28f30a722629cb4713177064f6422e2 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 4 Dec 2012 16:04:21 +0900 Subject: [PATCH] Dismiss sliding key input preview when touch event is canceled This is a follow up of Id807af31. Bug: 7662486 Change-Id: I13895140f1214592257d0023c1450875a4885ee9 --- java/src/com/android/inputmethod/keyboard/KeyboardView.java | 5 +++++ .../src/com/android/inputmethod/keyboard/PointerTracker.java | 3 ++- .../inputmethod/keyboard/internal/PreviewPlacerView.java | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 51fb3701c..992282bf9 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -860,6 +860,11 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { mPreviewPlacerView.showSlidingKeyInputPreview(tracker); } + @Override + public void dismissSlidingKeyInputPreview() { + mPreviewPlacerView.dismissSlidingKeyInputPreview(); + } + public void showGestureFloatingPreviewText(final String gestureFloatingPreviewText) { locatePreviewPlacerView(); mPreviewPlacerView.setGestureFloatingPreviewText(gestureFloatingPreviewText); diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 035fb58f8..d9a520917 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -82,6 +82,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element { public void showKeyPreview(PointerTracker tracker); public void dismissKeyPreview(PointerTracker tracker); public void showSlidingKeyInputPreview(PointerTracker tracker); + public void dismissSlidingKeyInputPreview(); public void showGesturePreviewTrail(PointerTracker tracker, boolean isOldestTracker); } @@ -881,7 +882,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element { private void resetSlidingKeyInput() { mIsInSlidingKeyInput = false; mIsInSlidingKeyInputFromModifier = false; - mDrawingProxy.showSlidingKeyInputPreview(this); + mDrawingProxy.dismissSlidingKeyInputPreview(); } private void onGestureMoveEvent(final int x, final int y, final long eventTime, diff --git a/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java b/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java index 7847499cd..bc734b08d 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java +++ b/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java @@ -220,6 +220,10 @@ public final class PreviewPlacerView extends RelativeLayout { invalidate(); } + public void dismissSlidingKeyInputPreview() { + mShowSlidingKeyInputPreview = false; + } + @Override protected void onDetachedFromWindow() { freeOffscreenBuffer();