예제 #1
0
 private void sendDownEvent() {
   if (DEBUG) {
     PtrCLog.d(LOG_TAG, "send down event");
   }
   final MotionEvent last = mLastMoveEvent;
   MotionEvent e =
       MotionEvent.obtain(
           last.getDownTime(),
           last.getEventTime(),
           MotionEvent.ACTION_DOWN,
           last.getX(),
           last.getY(),
           last.getMetaState());
   dispatchTouchEventSupper(e);
 }
예제 #2
0
 private void sendCancelEvent() {
   if (DEBUG) {
     PtrCLog.d(LOG_TAG, "send cancel event");
   }
   MotionEvent last = mDownEvent;
   last = mLastMoveEvent;
   MotionEvent e =
       MotionEvent.obtain(
           last.getDownTime(),
           last.getEventTime() + ViewConfiguration.getLongPressTimeout(),
           MotionEvent.ACTION_CANCEL,
           last.getX(),
           last.getY(),
           last.getMetaState());
   dispatchTouchEventSupper(e);
 }
예제 #3
0
 private void sendCancelEvent() {
   if (DEBUG) {
     PtrCLog.d(LOG_TAG, "send cancel event");
   }
   // The ScrollChecker will update position and lead to send cancel event when mLastMoveEvent is
   // null.
   // fix #104, #80, #92
   if (mLastMoveEvent == null) {
     return;
   }
   MotionEvent last = mLastMoveEvent;
   MotionEvent e =
       MotionEvent.obtain(
           last.getDownTime(),
           last.getEventTime() + ViewConfiguration.getLongPressTimeout(),
           MotionEvent.ACTION_CANCEL,
           last.getX(),
           last.getY(),
           last.getMetaState());
   dispatchTouchEventSupper(e);
 }