Scroll down to load data using recycleview and SwipeRefreshLayout

1.8k views Asked by At

We've been looking around for the implementation of the new material design swipe down to refresh on RecyclerViews with the loading circle coming down from bottom view same like new gmail app.i found so many things. But not getting new gmail app like example or demo .i already implement refreshlayout and recycleview.

But when scroll down to recycleview,how to put loading circle at the last of the record in recycleview. I want to get some idea to put in onscroll of recycleview.

recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrollStateChanged(int arg0) {
            }

            @Override
            public void onScrolled(int arg0, int arg1) {

                //add some data but not to show loader.
                getDataFromDB();

            }
        });
3

There are 3 answers

0
Rajan Bhavsar On

hi If you wan't to develop such a kind of Layout then please follow this url, i was used it it's an awesome.

https://github.com/stormzhang/SwipeRefreshLayoutDemo

1
Kostya Rudenko On

You should wrap all your layouts with pull to refresh component for that. after swipeRefreshLayout.setOnRefreshListener and set swipeRefreshLayout.setRefreshing(true); when you send API call

0
Sanjay Bhalani On

hear is awesome demo for both Scroll down to load data using recycleview and Swipe to RefreshLayout.