The app aims to demonstrate the power of a new paging library combined with data-binding and superior architecture in android app development.
Comman contains standred error adapters and UI. Data has models, repo and pagingnation logics. DI Hilt dependency injection Network has retrofit request apis. UI has activity, adapters, and UI state for handling data and connection status. ViewModels logics to handle data get from repository.
To give overview here I have a flowchart. Here paging source class process pulling data with specific config for paging like page number.
- PagingSource class for the process of pulling the data,responsible for the source of the paginated data.
- LoadParam holds the page number to be loaded,
LOADSIZE*3 items during the first load . - @LoadResult as return type.
- @getRefreshKey abstract method for subsequent refresh calls to @PagingSource.load().
Take a look at code itself. https://gist.github.com/pranimation/0c29c7ed5ef3e3067e6741487b0a705a