Code Monkey home page Code Monkey logo

Comments (5)

jdsjlzx avatar jdsjlzx commented on May 27, 2024 1

没有数据时显示一个EmptyView,此时的RecyclerView是隐藏的。无论是淘宝还是其他app,都是类似的处理。没有网络或者加载出错,点击中间的view可以重新加载!参考:https://github.com/stay4it/Community 这个效果的实现!

至于你的需求:无论当前有无数据都可以下拉 是产品要求还是自己测试呢? 你可以参考一下主流app的实现。

from lrecyclerview.

jdsjlzx avatar jdsjlzx commented on May 27, 2024

可以为EmptyView添加点击事件,请求数据!参考:https://github.com/stay4it/Community

from lrecyclerview.

daiwj avatar daiwj commented on May 27, 2024

我从你的demo apk 上没有发现这个效果。

需求是下拉操作无论当前有无数据都可以下拉,同时,没有数据时显示一个EmptyView提示用户重新下拉加载,希望可以添加这样的功能。

from lrecyclerview.

daiwj avatar daiwj commented on May 27, 2024

这个需求是产品提的,没办法...
单纯的使用ListView/RecyclerView是实现不了这个效果。我目前的做法是 自己实现了一个下拉刷新,不过是在外层包裹的一层。QQ消息列表界面是可以做到的,不知道是不是 在没有数据的时候放了一个HeaderView或者FooterView。

from lrecyclerview.

Tiannuo avatar Tiannuo commented on May 27, 2024

只需要在获取数据list的size==0的时候让 Recyclerview.setVisibility(View.VISIBLE);就可以

from lrecyclerview.

Related Issues (20)

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.