Git Product home page Git Product logo

Comments (3)

tangxianqiang avatar tangxianqiang commented on August 26, 2024

这个给itemType无关,是事件冲突了,可以解决,我早上给你看一看

from lightrefresh.

zhangxianpeng avatar zhangxianpeng commented on August 26, 2024

好的,解决了请及时回复,谢谢

from lightrefresh.

tangxianqiang avatar tangxianqiang commented on August 26, 2024

你可以参照我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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.