Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onloadmore called when first call fails #41

Open
blackhawk389 opened this issue Oct 12, 2018 · 2 comments
Open

onloadmore called when first call fails #41

blackhawk389 opened this issue Oct 12, 2018 · 2 comments
Labels
triage In process of defining what kind of issue this is (bug, enhancement etc)

Comments

@blackhawk389
Copy link

onloadmore method is called even if its not end of page, I would like to understand in what condition onloadmore will be called

Thanks!

@lnztmtr
Copy link

lnztmtr commented Feb 16, 2019

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();
    }

@MarkoMilos
Copy link
Owner

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?

@MarkoMilos MarkoMilos added the triage In process of defining what kind of issue this is (bug, enhancement etc) label Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage In process of defining what kind of issue this is (bug, enhancement etc)
Projects
None yet
Development

No branches or pull requests

3 participants