GestureDetector - fix longPress timeout

Remove adding the TAP_TIMEOUT to the LONGPRESS_TIMEOUT
in order to inline the longpress detection logic with
the non-GestureDetector framework implementations.

Bug: 30895236
Bug: 30937837
Change-Id: I67f4fa141804ae645553eb4edc8a80a512d018c5
This commit is contained in:
Andrei Stingaceanu
2016-08-18 15:44:38 +01:00
parent 70528f5b6c
commit a13f7f363f

View File

@@ -583,10 +583,11 @@ public class GestureDetector {
if (mIsLongpressEnabled) {
mHandler.removeMessages(LONG_PRESS);
mHandler.sendEmptyMessageAtTime(LONG_PRESS, mCurrentDownEvent.getDownTime()
+ TAP_TIMEOUT + LONGPRESS_TIMEOUT);
mHandler.sendEmptyMessageAtTime(LONG_PRESS,
mCurrentDownEvent.getDownTime() + LONGPRESS_TIMEOUT);
}
mHandler.sendEmptyMessageAtTime(SHOW_PRESS, mCurrentDownEvent.getDownTime() + TAP_TIMEOUT);
mHandler.sendEmptyMessageAtTime(SHOW_PRESS,
mCurrentDownEvent.getDownTime() + TAP_TIMEOUT);
handled |= mListener.onDown(ev);
break;