3

I'm using paging library to load and display the data from server:

dataFactory = DataSourceFactory()
val config = PagedList.Config.Builder()
    .setPageSize(25)
    .setInitialLoadSizeHint(25 * 2)
    .setEnablePlaceholders(false)
    .build()
dataList = LivePagedListBuilder<Int, CreditTransaction>(dataFactory, config).build()
adapter.submitList(dataList.value)

I'm also using the PageKeyedDataSource for DataSourceFactory

And when I scroll the list for a long time I have lots of items in memory. I also know that since Paging 2.1.0-alpha01 we have page dropping, PagedList.Config.Builder.setMaxSize() for limiting the number of loaded items in memory. But this feature doesn't work with PageKeyedDataSource. Are there other solutions for limiting the number of loaded items in memory which can work with PageKeyedDataSource?

4

0 回答 0