Another Endless RecyclerView
Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add this in your app build.gradle
file
dependencies {
...
compile 'com.github.spurdow:rvlazyscroll:1.0.4'
}
}
RVLazyScroll<Person> endless = new RVLazyScroll<Person>(mLinearLayoutManager) {
@Override
public List<Person> onLoadMore(int offset) {
// your query here and move it to list Person
return new ArrayList<Person>(){new Person()};
}
@Override
public void onDoneLoad(List<Person> newListOfdata) {
// this is where your add it to your adapter
adapter.addAll(newListOfdata);
}
};
RecyclerView recyclerView ;
recyclerView.addOnScrollListener(endless);
int lastVisibleThreshold = 2;
RVLazyScroll<Person> endless = new RVLazyScroll<Person>(mLinearLayoutManager , lastVisibleThreshold) {
@Override
public List<Person> onLoadMore(int offset) {
// your query here and move it to list Person
return new ArrayList<Person>(){new Person()};
}
@Override
public void onDoneLoad(List<Person> newListOfdata) {
// this is where your add it to your adapter
adapter.addAll(newListOfdata);
}
};
RecyclerView recyclerView ;
recyclerView.addOnScrollListener(endless);
Added Support for Grid and Staggered
Added Support for last visible threshold