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

建议把 dy 的触摸距离判断改成与 TouchSlop 比较而不是与0比较 #73

Open
jiang111 opened this issue May 22, 2017 · 5 comments

Comments

@jiang111
Copy link

否则item 的点击事件太容易被你这个刷新控件拿去

@byte-engine-chenxiaojian

大神 我也遇到了这个问题 请问是怎么解决的

@jiang111
Copy link
Author

jiang111 commented Jun 2, 2017

我是直接把库下载下来自己改的,把 MaterialRefreshLayout 这个类的onInterceptTouchEvent 方法里的
if (dy > 0 && !canChildScrollUp()) {} 改成 if (dy > ViewConfiguration.getTouchSlop() && !canChildScrollUp()) {} 这样处理刷新操作,加载更多也可以这么改

@byte-engine-chenxiaojian

谢谢 我下拉刷新没问题 只是下拉加载里边 点击item会被刷新回去到 dy < 0 && !canChildScrollDown() && isLoadMore 这个后边加上&&Math.abs(dy)>8 这样判断也可以屏蔽掉。谢谢大神提示了。

@jiang111
Copy link
Author

jiang111 commented Jun 2, 2017

建议 >8 这样的判断还是把 8 改成用 ViewConfiguration.getTouchSlop() 比较好

@Coffeeljn
Copy link

太厉害了,解决了困扰我很久的问题,谢谢大神~~

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

3 participants