I want to implement load more in Recyclerview. Here is the code. The code is from github. https://gist.github.com/ssinss/e06f12ef66c51252563e
MainActivity code:
Try this....
static boolean loadmore=true;
LinearLayoutManager layoutManager = ((LinearLayoutManager)recyclerView.getLayoutManager());
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
// super.onScrolled(recyclerView, dx, dy);
int lastVisiblePosition = layoutManager.findLastVisibleItemPosition();
if (lastVisiblePosition == recyclerView.getChildCount()) {
if (loadmore) {
loadmore = false;
method();
}
}
}
});
private void method(){
loadmore=true;
}
This links may help you .for load-moreRrecyclerview you need to change. and implement using Link
or library