Comments (3)
这个给itemType无关,是事件冲突了,可以解决,我早上给你看一看
from lightrefresh.
好的,解决了请及时回复,谢谢
from lightrefresh.
你可以参照我demo里面的 RecyclerView+ViewPager的做法,原理都是一样的。我自己做了横向滚动的测试,没有问题的。你也可以再看看我发布在简书上的文章https://www.jianshu.com/p/a8f3563d42cb 因为LightRefresh是在回调中实时做的冲突处理,所以你可以看看这方法的具体实现(这是下拉刷新加侧拉删除的冲突处理代码)
bounceLayout.setEventForwardingHelper((downX, downY, moveX, moveY) -> {
View view = rvAddress.findChildViewUnder(downX,downY);//获取列表中正在进行事件的item
if (view!=null) {
if (Math.abs(view.getScrollX()) > 0) {
bounceLayout.setRefreshCompleted();//这样会初始化bounceLayout
return false;//侧拉
}
}
//判断是侧拉还是下拉刷新, x>y 侧拉,反之
float distanceX = Math.abs(moveX - downX);
float distanceY = Math.abs(moveY - downY);
return !(distanceX >= distanceY);//进行判断
});
这个回调为false则表示子view自己消费事件,也就是你的横向滚动之类的响应,而不是响应下拉刷新,注意使用的版本:com.github.BLCodes:LightRefresh:1.0.3-beta-6 其实在这个回调中可以很灵活的处理事件冲突,关键在于怎么返回true和false。如果你确实不能 解决,加我QQ:2927001935,我会帮助你解决
from lightrefresh.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightrefresh.