diff options
author | 2010-09-02 04:33:27 -0700 | |
---|---|---|
committer | 2010-09-02 04:33:27 -0700 | |
commit | a4397ce38af2e1ac3a8284bc078bd1e9cb4fecf4 (patch) | |
tree | e7d7fe284ecaef9cc7c0b5d818837800e699d74f /java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | |
parent | 3e6bd26f7d2d78c3c2ae123d0f34682d374371f6 (diff) | |
parent | 6b4d521fb486f2762eee1a7ebf3c5e285d3aa83e (diff) | |
download | latinime-a4397ce38af2e1ac3a8284bc078bd1e9cb4fecf4.tar.gz latinime-a4397ce38af2e1ac3a8284bc078bd1e9cb4fecf4.tar.xz latinime-a4397ce38af2e1ac3a8284bc078bd1e9cb4fecf4.zip |
am 6b4d521f: Merge "Add PointerTracker argument to long press related methods" into gingerbread
Merge commit '6b4d521fb486f2762eee1a7ebf3c5e285d3aa83e' into gingerbread-plus-aosp
* commit '6b4d521fb486f2762eee1a7ebf3c5e285d3aa83e':
Add PointerTracker argument to long press related methods
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java index 30042d8a1..14b8143a9 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java @@ -254,9 +254,11 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener, startKeyRepeatTimer(REPEAT_INTERVAL, msg.arg1, tracker); break; } - case MSG_LONGPRESS_KEY: - openPopupIfRequired(msg.arg1); + case MSG_LONGPRESS_KEY: { + final PointerTracker tracker = (PointerTracker)msg.obj; + openPopupIfRequired(msg.arg1, tracker); break; + } } } @@ -299,9 +301,9 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener, return mInKeyRepeat; } - public void startLongPressTimer(int keyIndex, long delay) { + public void startLongPressTimer(long delay, int keyIndex, PointerTracker tracker) { removeMessages(MSG_LONGPRESS_KEY); - sendMessageDelayed(obtainMessage(MSG_LONGPRESS_KEY, keyIndex, 0), delay); + sendMessageDelayed(obtainMessage(MSG_LONGPRESS_KEY, keyIndex, 0, tracker), delay); } public void cancelLongPressTimer() { @@ -962,16 +964,15 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener, key.x + key.width + getPaddingLeft(), key.y + key.height + getPaddingTop()); } - private boolean openPopupIfRequired(int keyIndex) { + private boolean openPopupIfRequired(int keyIndex, PointerTracker tracker) { // Check if we have a popup layout specified first. if (mPopupLayout == 0) { return false; } - if (keyIndex < 0 || keyIndex >= mKeys.length) { - return false; - } - Key popupKey = mKeys[keyIndex]; + Key popupKey = tracker.getKey(keyIndex); + if (popupKey == null) + return false; boolean result = onLongPress(popupKey); if (result) { dismissKeyPreview(); |