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) {
|
public void startLongPressTimer(long delay, int keyIndex, PointerTracker tracker) {
|
||||||
removeMessages(MSG_LONGPRESS_KEY);
|
cancelLongPressTimers();
|
||||||
sendMessageDelayed(obtainMessage(MSG_LONGPRESS_KEY, keyIndex, 0, tracker), delay);
|
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) {
|
public void startLongPressShiftTimer(long delay, int keyIndex, PointerTracker tracker) {
|
||||||
removeMessages(MSG_LONGPRESS_SHIFT_KEY);
|
cancelLongPressTimers();
|
||||||
sendMessageDelayed(
|
sendMessageDelayed(
|
||||||
obtainMessage(MSG_LONGPRESS_SHIFT_KEY, keyIndex, 0, tracker), delay);
|
obtainMessage(MSG_LONGPRESS_SHIFT_KEY, keyIndex, 0, tracker), delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelLongPressShiftTimer() {
|
public void cancelLongPressTimers() {
|
||||||
|
removeMessages(MSG_LONGPRESS_KEY);
|
||||||
removeMessages(MSG_LONGPRESS_SHIFT_KEY);
|
removeMessages(MSG_LONGPRESS_SHIFT_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelKeyTimers() {
|
public void cancelKeyTimers() {
|
||||||
cancelKeyRepeatTimer();
|
cancelKeyRepeatTimer();
|
||||||
cancelLongPressTimer();
|
cancelLongPressTimers();
|
||||||
cancelLongPressShiftTimer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelAllMessages() {
|
public void cancelAllMessages() {
|
||||||
|
|
|
@ -315,11 +315,11 @@ public class PointerTracker {
|
||||||
} else {
|
} else {
|
||||||
if (keyState.getKeyIndex() != NOT_A_KEY) {
|
if (keyState.getKeyIndex() != NOT_A_KEY) {
|
||||||
keyState.onMoveToNewKey(keyIndex, x ,y);
|
keyState.onMoveToNewKey(keyIndex, x ,y);
|
||||||
mHandler.cancelLongPressTimer();
|
mHandler.cancelLongPressTimers();
|
||||||
} else if (!isMinorMoveBounce(x, y, keyIndex)) {
|
} else if (!isMinorMoveBounce(x, y, keyIndex)) {
|
||||||
resetMultiTap();
|
resetMultiTap();
|
||||||
keyState.onMoveToNewKey(keyIndex, x ,y);
|
keyState.onMoveToNewKey(keyIndex, x ,y);
|
||||||
mHandler.cancelLongPressTimer();
|
mHandler.cancelLongPressTimers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showKeyPreviewAndUpdateKeyGraphics(mKeyState.getKeyIndex());
|
showKeyPreviewAndUpdateKeyGraphics(mKeyState.getKeyIndex());
|
||||||
|
|
Loading…
Reference in New Issue