Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

快速频繁的向同一方向滑动有点不顺畅 #8

Open
alzmmx opened this issue Mar 30, 2022 · 1 comment
Open

快速频繁的向同一方向滑动有点不顺畅 #8

alzmmx opened this issue Mar 30, 2022 · 1 comment

Comments

@alzmmx
Copy link

alzmmx commented Mar 30, 2022

No description provided.

@alzmmx
Copy link
Author

alzmmx commented Apr 1, 2022

我的解决方案

 private int action = -1;

public void computeScroll() {
        if (isScrolling) {
            isScrolling = computeScrollOffset();
            //在move 事件中已调用了doScroll(),这里应该不再调用
            if (action != MotionEvent.ACTION_MOVE) {
                doScroll(getCurrY() - mScrollOffset);
            }
            if (isScrolling) {
                mWheelView.postInvalidate();
            } else {
                // 滚动结束后,重新调整位置
                justify();
            }
        }
    }


 public boolean onTouchEvent(MotionEvent event) {
     ...
        action = event.getAction();
     ...
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant