summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-07-08 21:26:29 -0700
committerTadashi G. Takaoka <takaoka@google.com>2011-07-10 18:06:42 -0700
commit0efe174ea43fe576683102effbaef5be27575706 (patch)
tree382a7cbd64694a9613da59cf075f249211ee4014 /java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java
parent952266674a0c7c20cbe1c66308f839f617cd38fd (diff)
Pass KeyboardView to PointerTracker on down event
Bug: 4768084 Change-Id: I446b98daef8c9ec2408481e59cb2a88754ef9e01
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java
index 33aa6c29c..318e454d3 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardBaseView.java
@@ -267,11 +267,22 @@ public class LatinKeyboardBaseView extends KeyboardView {
* Returns the {@link KeyboardActionListener} object.
* @return the listener attached to this keyboard
*/
- protected KeyboardActionListener getKeyboardActionListener() {
+ @Override
+ public KeyboardActionListener getKeyboardActionListener() {
return mKeyboardActionListener;
}
@Override
+ public KeyDetector getKeyDetector() {
+ return mKeyDetector;
+ }
+
+ @Override
+ public TimerProxy getTimerProxy() {
+ return mKeyTimerHandler;
+ }
+
+ @Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
// TODO: Should notify InputMethodService instead?
KeyboardSwitcher.getInstance().onSizeChanged();
@@ -545,7 +556,7 @@ public class LatinKeyboardBaseView extends KeyboardView {
// previous key.
final int newKeyIndex = tracker.getKeyIndexOn(x, y);
if (mOldKeyIndex != newKeyIndex) {
- tracker.onDownEvent(x, y, eventTime);
+ tracker.onDownEvent(x, y, eventTime, this);
if (action == MotionEvent.ACTION_UP)
tracker.onUpEvent(x, y, eventTime);
}
@@ -557,7 +568,7 @@ public class LatinKeyboardBaseView extends KeyboardView {
mOldKeyIndex = tracker.getKeyIndexOn(lastX, lastY);
tracker.onUpEvent(lastX, lastY, eventTime);
} else if (pointerCount == 1 && oldPointerCount == 1) {
- processMotionEvent(tracker, action, x, y, eventTime);
+ processMotionEvent(tracker, action, x, y, eventTime, this);
} else {
Log.w(TAG, "Unknown touch panel behavior: pointer count is " + pointerCount
+ " (old " + oldPointerCount + ")");
@@ -571,18 +582,18 @@ public class LatinKeyboardBaseView extends KeyboardView {
tracker.onMoveEvent((int)me.getX(i), (int)me.getY(i), eventTime);
}
} else {
- processMotionEvent(getPointerTracker(id), action, x, y, eventTime);
+ processMotionEvent(getPointerTracker(id), action, x, y, eventTime, this);
}
return true;
}
private static void processMotionEvent(PointerTracker tracker, int action, int x, int y,
- long eventTime) {
+ long eventTime, KeyboardView keyboardView) {
switch (action) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_POINTER_DOWN:
- tracker.onDownEvent(x, y, eventTime);
+ tracker.onDownEvent(x, y, eventTime, keyboardView);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP: