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

滑到最后一页,然后手速快一点滑动返回上一页,就会滚回到第一页 #19

Open
lihuanming opened this issue Jun 15, 2018 · 6 comments

Comments

@lihuanming
Copy link

如题,感觉是滑动判断有问题。

@GcsSloop
Copy link
Owner

总共多少页数据?
在比较用力的翻页情况下,会一次翻过2个页面的。

@lihuanming
Copy link
Author

一共6页

@lihuanming
Copy link
Author

对,用力就会翻过几个页面

@GcsSloop
Copy link
Owner

按照现有版本的设计原理上来说一次快速滑动最多只能翻过两个页面,如果多翻了说明逻辑是存在漏洞的。
但是我刚刚测试了一下,在这边的demo里面并没有测试出上述问题。如果可能的话,能否提供一下你那边关于这一部分的代码呢?

@YandZD
Copy link

YandZD commented Feb 25, 2019

private boolean mAllowContinuousScroll = true; //设置为false

@lhwCoding
Copy link

水平滚动 6页 会执行3次从右往左滑动,会回到第一页,设置下面属性都不行
pagerManger.setAllowContinuousScroll(false);
pagerManger.setChangeSelectInScrolling(false);
其scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler,
RecyclerView.State state)中的dx往左滑动变动值感觉有问题 一样的速度却能达到负五六千
添加一行 if (dx<-1000)dx=dx/2; 缩短移动数率
@Override public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler, RecyclerView.State state) { Logi("scrollHorizontallyBy dx= " + dx+",mOffsetX="+mOffsetX); int newX = mOffsetX + dx; if (dx<-1000)dx=dx/2;//修改左滑dx速率负数过大,出现跳页问题 int result = dx;

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

4 participants