GithubHelp home page GithubHelp logo

wangoceantao79 / double-direction-adapter-endless Goto Github PK

View Code? Open in Web Editor NEW

This project forked from songhanghang/double-direction-adapter-endless

0.0 2.0 0.0 2.62 MB

双向加载更多 recyclerview

License: MIT License

Java 100.00%

double-direction-adapter-endless's Introduction

double-direction-adapter-endless

powred by rv-adapter-endless https://github.com/rockerhieu/rv-adapter-endless

双向加载更多 recyclerview, 不同于上拉刷新,下拉加载更多。双向都是加载更多操作

EndlessRecyclerViewAdapter support for RecyclerView.Adapter

feature

  • 1,双向加载更多
  • 2,支持竖向,和横向
  • 3,装饰模式实现,不需要修改之前adapter。

when use

首次加载中间段数据,然后滚动时,需要加载中间段数据前和后的更多数据, eg: 乐视视频app(android) 播放页下半屏剧集card的滚动获取

Renderings

usage

recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setHasFixedSize(true);
        ArrayList<String> strings = new ArrayList<>();
        adapter = new SimpleStringAdapter(layoutManager, 30, strings);
        endlessRecyclerViewAdapter = new EndlessRecyclerViewAdapter(this, adapter, new EndlessRecyclerViewAdapter.RequestToLoadMoreListener() {
            @Override
            public void onAfterLoadMoreRequested() {
                //load onAfter
            }

            @Override
            public void onBeforeLoadMoreRequested() {
                //load before
            }
        });
        recyclerView.setAdapter(endlessRecyclerViewAdapter);

double-direction-adapter-endless's People

Contributors

songhanghang avatar

Watchers

 avatar  avatar

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.