Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

onItemAtEndLoaded is called immediately after onZeroItemsLoaded

I have a problem where the method onItemAtEndLoaded is called immediately after onZeroItemsLoaded, the behavior should be only when I finish the scroll. Do you have any idea of what is happening. I can provide my GitHub repo.

like image 815
José Nobre Avatar asked Jul 31 '18 22:07

José Nobre


1 Answers

I have solved it by setting PrefetchDistance to zero in PagedListConfig

PagedList.Config.Builder()
                .setPrefetchDistance(0) // solved
                .setInitialLoadSizeHint(pageSize)
                .setPageSize(pageSize)
like image 123
mallaudin Avatar answered Sep 20 '22 00:09

mallaudin