alinbabu2010 / QuotesApp

Android application that display a list of quotes.
MIT License
2 stars 0 forks source link

Why Mediator loading 2 page at beginning #1

Closed razi3742 closed 1 year ago

razi3742 commented 1 year ago

First of all thanks for a such a nice work. i am trying to use your library to integrate pagination with offline support. I run your application and see every time i run the application it Loads 2 pages at beginning. how I can restrict it to 1 page and request to next page once user goes to last item in recyclerview.

Additionaly can you please add refresh mechanism i have made some customization which run successfully but I face two issue 1- Recyclerview scroll goes to first page last item. Like in your case it recyclerview automatically scroll to 20 item 2- It calls 2 pages at once on adapter.refresh() function call.

waiting for your kind response

Once again thanks for such a great work with good explanation.

alinbabu2010 commented 1 year ago

It's a pleasure to know you have gained some knowledge from this repository.

Regarding the issue of loading 2 pages, I will look for more details and update the repo. Also, I will add a refresh to resolve the problems addressed if possible.

razi3742 commented 1 year ago

Thanks for a quick response I am doing difference expierments. If i set PageNo = 1 then Mediator call only one page. but i am not sure is this fine solution ? but on refresh my problem is same. can you please update your repository so i can use it. i just add these use to my production app.

alinbabu2010 commented 1 year ago

@razi3742 Please check the code in the master branch. I added a refresh mechanism with a workaround for scroll issue.

Also loading 2 pages issue for initial loading in my case by adding `initialLoadSize = 10' fixed the issue.

razi3742 commented 1 year ago

@alinbabu2010 thanks for such a Quick solution. I run the application and see its loading only 1 page at startup and in refresh also scrolling to first item.

Additionally, i have set following configs to restrict paging3 to load next page only when scroll to last item.

pageSize = 1, prefetchDistance = 0, maxSize = 100, initialLoadSize = 1

alinbabu2010 commented 1 year ago

@razi3742 Thanks for the configs I had just tried the configs and it worked.

razi3742 commented 1 year ago

@alinbabu2010 would you add retry mechanism in this repository later on ??

alinbabu2010 commented 1 year ago

@razi3742 I will try to add that too if get time.

razi3742 commented 1 year ago

@alinbabu2010 I have added retry mechanism and error handling as well. Please let me know if you need these updates. Thanks

alinbabu2010 commented 1 year ago

@razi3742 Could you please push that change to another branch into this repository? I had already done that but just know about your way of handling error and retry mechanism

rizwan-surveyauto commented 1 year ago

i am getting permission denied message while pushing code.

alinbabu2010 commented 1 year ago

@rizwan-surveyauto Please check the collab invitation and try to push the code.

rizwan-surveyauto commented 1 year ago

@alinbabu2010 Please check your pull request