Merge "Should cancel both normal and shift long press timers"
commit
02d7bdead6
|
@ -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