WheelView icon indicating copy to clipboard operation
WheelView copied to clipboard

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

Open alzmmx opened this issue 4 years ago • 1 comments

alzmmx avatar Mar 30 '22 07:03 alzmmx

我的解决方案

 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();
     ...
    }

alzmmx avatar Apr 01 '22 02:04 alzmmx