Skip to content

Instantly share code, notes, and snippets.

@varundwarkani
Last active April 25, 2021 10:38
Show Gist options
  • Save varundwarkani/6571437ad39282ffe25fbb037a3b0973 to your computer and use it in GitHub Desktop.
Save varundwarkani/6571437ad39282ffe25fbb037a3b0973 to your computer and use it in GitHub Desktop.
private LiveData<PagedList<UpcomingMatch>> pagedListLiveData;
UpcomingMatchesDataSourceFactory upcomingMatchesDataSourceFactory = new UpcomingMatchesDataSourceFactory(upcomingMatchesRepository);
pageKeyedDataSourceLiveData = upcomingMatchesDataSourceFactory.getPageKeyedDataSourceMutableLiveData();
PagedList.Config pagedListConfig =
(new PagedList.Config.Builder())
.setEnablePlaceholders(false)
.setPageSize(UpcomingMatchesDataSource.PAGE_SIZE).build();
pagedListLiveData = (new LivePagedListBuilder<>(upcomingMatchesDataSourceFactory, pagedListConfig)).build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment