@Override public void run() { parent.dispatchTouchEvent(event); } });
@Override public void run() { parent.dispatchTouchEvent(event); } });
@Override public void run() { parent.dispatchTouchEvent(event); } });
@Override public void run() { parent.dispatchTouchEvent(event); } });
@Override public void run() { parent.dispatchTouchEvent(event); } });
@Override public boolean dispatchTouchEvent(MotionEvent ev) { int action = ev.getActionMasked(); // 按下时保存坐标信息 if (action == MotionEvent.ACTION_DOWN) { this.downPoint.x = (int) ev.getX(); this.downPoint.y = (int) ev.getY(); } return super.dispatchTouchEvent(ev); }
@Override public boolean dispatchTouchEvent(MotionEvent ev) { if (timer != null) { final int action = ev.getAction(); if (action == MotionEvent.ACTION_DOWN) { stopTimer(); } if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { startTimer(); } } return super.dispatchTouchEvent(ev); }
@Override public boolean dispatchTouchEvent(MotionEvent ev) { if (timer != null) { final int action = ev.getAction(); if (action == MotionEvent.ACTION_DOWN) { stopTimer(); } if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { startTimer(); } } return super.dispatchTouchEvent(ev); }
@Override public boolean dispatchTouchEvent(MotionEvent ev) { final int action = MotionEventCompat.getActionMasked(ev); switch (action) { case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: // support compile sdk version < 23 onStopNestedScroll(this); break; default: break; } return super.dispatchTouchEvent(ev); }
@Override public boolean dispatchTouchEvent(MotionEvent ev) { final int action = MotionEventCompat.getActionMasked(ev); switch (action) { case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: // swipeToRefresh -> finger up -> finger down if the status is still swipeToRefresh // in onInterceptTouchEvent ACTION_DOWN event will stop the scroller // if the event pass to the child view while ACTION_MOVE(condition is false) // in onInterceptTouchEvent ACTION_MOVE the ACTION_UP or ACTION_CANCEL will not be // passed to onInterceptTouchEvent and onTouchEvent. Instead It will be passed to // child view's onTouchEvent. So we must deal this situation in dispatchTouchEvent onActivePointerUp(); break; } return super.dispatchTouchEvent(ev); }
return super.dispatchTouchEvent(ev); return super.dispatchTouchEvent(ev); return super.dispatchTouchEvent(ev); return super.dispatchTouchEvent(ev); super.dispatchTouchEvent(up); up.recycle(); return super.dispatchTouchEvent(ev); return super.dispatchTouchEvent(ev);
if (mNestedInProgress) {//嵌套滚动时,补充竖直方向不滚动,但是水平方向滚动,需要通知 onHorizontalDrag int totalUnconsumed = mTotalUnconsumed; boolean ret = super.dispatchTouchEvent(e); || (mHeaderNeedTouchEventWhenRefreshing && ((mState.isOpening || mState.isFinishing) && mState.isHeader)) || (mFooterNeedTouchEventWhenLoading && ((mState.isOpening || mState.isFinishing) && mState.isFooter))) { return super.dispatchTouchEvent(e); mSuperDispatchTouchEvent = super.dispatchTouchEvent(e); if (mState == RefreshState.TwoLevel && mTouchY < 5 * thisView.getMeasuredHeight() / 6) { mDragDirection = 'h';//二级刷新标记水平滚动来禁止拖动 super.dispatchTouchEvent(e); if (mFalsifyEvent == null) { mFalsifyEvent = obtain(time, time, MotionEvent.ACTION_DOWN, mTouchX + dx, mTouchY, 0); super.dispatchTouchEvent(mFalsifyEvent); super.dispatchTouchEvent(em); if (mFooterLocked && dy > mTouchSlop && mSpinner < 0) { mFooterLocked = false;//内容向下滚动时 解锁Footer 的锁定 mFalsifyEvent = null; em.setAction(MotionEvent.ACTION_CANCEL); super.dispatchTouchEvent(em); long time = e.getEventTime(); MotionEvent ec = obtain(time, time, action, mTouchX, touchY, 0); super.dispatchTouchEvent(ec);
@Override public boolean dispatchTouchEvent(MotionEvent ev) { float x = ev.getX(); float y = ev.getY(); switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: isSliding = false; mDownX = x; mTempY = mDownY = y; if (!mScroller.isFinished()) { //当上一次滑动没有结束时,再次点击,强制滑动在点击位置结束 mScroller.setFinalY(mScroller.getCurrY()); mScroller.abortAnimation(); scrollTo(0, getScrollY()); isSliding = true; } break; case MotionEvent.ACTION_MOVE: if (!isSliding) { isSliding = isCanSliding(ev); } break; default: break; } return super.dispatchTouchEvent(ev); }
return super.dispatchTouchEvent(ev);
return super.dispatchTouchEvent(ev);
break; return super.dispatchTouchEvent(event);
rootView.dispatchTouchEvent(event); return true; });
@Override public boolean dispatchTouchEvent(MotionEvent event) { if (DEBUG) Log.d(TAG, "dispatchTouchEvent() start "); boolean ret = super.dispatchTouchEvent(event); if (event.getAction() == MotionEvent.ACTION_DOWN) ret = true; if (DEBUG) Log.d(TAG, "dispatchTouchEvent() " + ret); return ret; }
@Override public boolean onTouchEvent(MotionEvent event) { super.onTouchEvent(event); // Pass touch events to tools for killing idle even when the progress dialog is shown. return tools.dispatchTouchEvent(event); }
@Override public boolean dispatchTouchEvent(MotionEvent ev) { switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: if (!mScroller.isFinished()) { break; } startX = (int) ev.getX(); break; } return super.dispatchTouchEvent(ev); }