You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The key is to controll hasLoadedAllItems method in Paginate.Callbacks class , like:
@OverRide
public boolean hasLoadedAllItems() {
return hasLoadedAllItems;
}
then:
/**
list is a page of data returned from the interface
ONE_PAGE_COUNT is request once data count specified by the interface
**/
public void setHasLoadedAllItems(List list){
if( list==null || list.size() < ONE_PAGE_COUNT){
this.hasLoadedAllItems=true;
}else {
this.hasLoadedAllItems=false;
}
}
this is success callback of interface
public void onGetWaitingListSuccess(List visitWaitingListBeans,boolean pullToRefresh) {
setHasLoadedAllItems(visitWaitingListBeans);
if(pullToRefresh){
mVisitWaitingListBeans.clear();
}
mVisitWaitingListBeans.addAll(visitWaitingListBeans);
notifyView();
}
onloadmore method is called even if its not end of page, I would like to understand in what condition onloadmore will be called
Thanks!
onLoadMore is called when the threshold (number of items not displayed at the end of the list) is reached. You can set a custom threshold via builder (default is 5).
Can you provide your code example of paginate initialization? Also, can you explain a bit more what behavior you are experiencing and what are you expecting?
onloadmore method is called even if its not end of page, I would like to understand in what condition onloadmore will be called
Thanks!
The text was updated successfully, but these errors were encountered: