diff options
| author | Yohei Yukawa <yukawa@google.com> | 2014-01-08 16:39:55 +0900 |
|---|---|---|
| committer | Yohei Yukawa <yukawa@google.com> | 2014-01-09 12:27:31 +0900 |
| commit | df10aeb1da87f980e5d0512133261e2c92c688a7 (patch) | |
| tree | 590ca194be24684bf68645ef2ea7d0ac826ff71c /java/src/com/android/inputmethod/keyboard/internal/EmojiPageKeyboardView.java | |
| parent | 6d5f9fd3d1ee903f9355905326cd75e7ee603d4e (diff) | |
Trigger haptic feedback at touch down on the EmojiPalettesView
EmojiPalettesView triggers the haptic feedback at the timing of touch-up rather than touch-down.
This patch set changes the timing to touch-up so that the UX on the EmojiPalettesView can be consistent with normal keyboard layouts.
This patch set also fixes the missing haptic feedback from facemarks such as ":-)".
Bug: 11439600
Change-Id: I22245946712bd1c36226786d6ff81e3b563f7ef7
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/internal/EmojiPageKeyboardView.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/EmojiPageKeyboardView.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/EmojiPageKeyboardView.java b/java/src/com/android/inputmethod/keyboard/internal/EmojiPageKeyboardView.java index 2e80f7962..5c7c6e39d 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/EmojiPageKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/internal/EmojiPageKeyboardView.java @@ -35,16 +35,19 @@ import com.android.inputmethod.latin.R; // TODO: Implement key popup preview. public final class EmojiPageKeyboardView extends KeyboardView implements GestureDetector.OnGestureListener { - public interface OnKeyClickListener { - public void onKeyClick(Key key); + public interface OnKeyEventListener { + public void onPressKey(Key key); + public void onReleaseKey(Key key); } - private static final OnKeyClickListener EMPTY_LISTENER = new OnKeyClickListener() { - @Override - public void onKeyClick(final Key key) {} + private static final OnKeyEventListener EMPTY_LISTENER = new OnKeyEventListener() { + @Override + public void onPressKey(final Key key) {} + @Override + public void onReleaseKey(final Key key) {} }; - private OnKeyClickListener mListener = EMPTY_LISTENER; + private OnKeyEventListener mListener = EMPTY_LISTENER; private final KeyDetector mKeyDetector = new KeyDetector(0.0f /*keyHysteresisDistance */); private final GestureDetector mGestureDetector; @@ -59,7 +62,7 @@ public final class EmojiPageKeyboardView extends KeyboardView implements mGestureDetector.setIsLongpressEnabled(false /* isLongpressEnabled */); } - public void setOnKeyClickListener(final OnKeyClickListener listener) { + public void setOnKeyEventListener(final OnKeyEventListener listener) { mListener = listener; } @@ -115,9 +118,9 @@ public final class EmojiPageKeyboardView extends KeyboardView implements if (key == null) { return false; } - // TODO: May call {@link KeyboardActionListener#onPressKey(int,int,boolean)}. key.onPressed(); invalidateKey(key); + mListener.onPressKey(key); return false; } @@ -133,10 +136,9 @@ public final class EmojiPageKeyboardView extends KeyboardView implements if (key == null) { return false; } - // TODO: May call {@link KeyboardActionListener#onReleaseKey(int,boolean)}. key.onReleased(); invalidateKey(key); - mListener.onKeyClick(key); + mListener.onReleaseKey(key); return true; } |
