Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is it that LoadParams.requestedLoadSize returns the specified page size to LivePagedListBuilder times 3?

I am creating a PagedList using:

LivePagedListBuilder(dataSourceFactory, 20)

Inside my implementation of PageKeyedDataSource, loadParams.requestedLoadSize returns 60. I tried with other numbers, and it seems that loadParams.requestedLoadSize always returns the page size I specified times three.

Anyone has any idea as to why this is happening?

like image 679
owl777 Avatar asked Jun 22 '18 14:06

owl777


1 Answers

Inside PagingConfig you can set initialLoadSize to the number you need to set at the first time when loading the list

Pager(
        config = PagingConfig(
            pageSize = PAGE_SIZE,
            initialLoadSize = 10 //if you need to load 10 items at the first time
        )
    )
like image 111
EslamWael74 Avatar answered Oct 21 '22 03:10

EslamWael74