Should cancel both normal and shift long press timers

Bug: 3132881

Change-Id: Ib89e2efa4e68e7d57ac1123df2ec6241f1b902d1
main
Tadashi G. Takaoka 2010-11-09 11:57:41 -08:00
parent f8e30a9153
commit 8aaab7c286
2 changed files with 7 additions and 11 deletions

View File

@ -332,28 +332,24 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy {
}
public void startLongPressTimer(long delay, int keyIndex, PointerTracker tracker) {
removeMessages(MSG_LONGPRESS_KEY);
cancelLongPressTimers();
sendMessageDelayed(obtainMessage(MSG_LONGPRESS_KEY, keyIndex, 0, tracker), delay);
}
public void cancelLongPressTimer() {
removeMessages(MSG_LONGPRESS_KEY);
}
public void startLongPressShiftTimer(long delay, int keyIndex, PointerTracker tracker) {
removeMessages(MSG_LONGPRESS_SHIFT_KEY);
cancelLongPressTimers();
sendMessageDelayed(
obtainMessage(MSG_LONGPRESS_SHIFT_KEY, keyIndex, 0, tracker), delay);
}
public void cancelLongPressShiftTimer() {
public void cancelLongPressTimers() {
removeMessages(MSG_LONGPRESS_KEY);
removeMessages(MSG_LONGPRESS_SHIFT_KEY);
}
public void cancelKeyTimers() {
cancelKeyRepeatTimer();
cancelLongPressTimer();
cancelLongPressShiftTimer();
cancelLongPressTimers();
}
public void cancelAllMessages() {

View File

@ -315,11 +315,11 @@ public class PointerTracker {
} else {
if (keyState.getKeyIndex() != NOT_A_KEY) {
keyState.onMoveToNewKey(keyIndex, x ,y);
mHandler.cancelLongPressTimer();
mHandler.cancelLongPressTimers();
} else if (!isMinorMoveBounce(x, y, keyIndex)) {
resetMultiTap();
keyState.onMoveToNewKey(keyIndex, x ,y);
mHandler.cancelLongPressTimer();
mHandler.cancelLongPressTimers();
}
}
showKeyPreviewAndUpdateKeyGraphics(mKeyState.getKeyIndex());