Should cancel both normal and shift long press timers
Bug: 3132881 Change-Id: Ib89e2efa4e68e7d57ac1123df2ec6241f1b902d1main
parent
f8e30a9153
commit
8aaab7c286
|
@ -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() {
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue