lucasr/twoway-view

Implement Endless list

Closed this issue · 4 comments

Can you please implement functionality of Endless list with this Twoway- view so for huge data loading its good to use.

Thanks
Nkpatel

This is something you have to implement in your own adapter.

well, how?!! how to implement this in adapter?!

in found solution

mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
@OverRide
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {

            visibleItemCount = mRecyclerView.getChildCount();
            totalItemCount = adapter.getItemCount();
            pastVisiblesItems = mRecyclerView.getFirstVisiblePosition();
            adapter.notifyDataSetChanged();

            if (loading) {
                if ((visibleItemCount + pastVisiblesItems) >= totalItemCount) {
                    loading = false;
                    Log.v("...", "Last Item Wow !");

                 // REQUEST LOAD MORE

                    adapter.notifyDataSetChanged();
                }
            }
        }
    });

@arashsammak I was gonna implement the above method. Are there any updates to it, or does it work fine?