Implement Endless list
Closed this issue · 4 comments
Uname-nikunj commented
Can you please implement functionality of Endless list with this Twoway- view so for huge data loading its good to use.
Thanks
Nkpatel
lucasr commented
This is something you have to implement in your own adapter.
arashsammak commented
well, how?!! how to implement this in adapter?!
arashsammak commented
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();
}
}
}
});
summers314 commented
@arashsammak I was gonna implement the above method. Are there any updates to it, or does it work fine?