小编joh*_*ong的帖子

在android 5 onInterceptTouchEvent模块中SwipeRefreshLayout.java没有中断

我注意到该函数在Action_down之后没有中断,那么代码可以运行到ACTION_MOVE,是吗?

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
    ensureTarget();

    final int action = MotionEventCompat.getActionMasked(ev);

    if (mReturningToStart && action == MotionEvent.ACTION_DOWN) {
        mReturningToStart = false;
    }

    if (!isEnabled() || mReturningToStart || canChildScrollUp() || mRefreshing) {
        // Fail fast if we're not in a state where a swipe is possible
        return false;
    }

    switch (action) {
        case MotionEvent.ACTION_DOWN:
            setTargetOffsetTopAndBottom(mOriginalOffsetTop - mCircleView.getTop(), true);
            mActivePointerId = MotionEventCompat.getPointerId(ev, 0);
            mIsBeingDragged = false;
            final float initialMotionY = getMotionEventY(ev, mActivePointerId);
            if (initialMotionY == -1) {
                return false;
            } …
Run Code Online (Sandbox Code Playgroud)

android motionevent swiperefreshlayout

5
推荐指数
1
解决办法
2232
查看次数

标签 统计

android ×1

motionevent ×1

swiperefreshlayout ×1