Slide 50
Slide 50 text
class ConcertBoundaryCallback(
private val query: String,
private val service: MyService,
private val cache: MyLocalCache
) : PagedList.BoundaryCallback() {
// Requests initial data from the network, replacing all content currently
// in the database.
override fun onZeroItemsLoaded() {
requestAndReplaceInitialData(query)
}
// Requests additional data from the network, appending the results to the
// end of the database's existing data.
override fun onItemAtEndLoaded(itemAtEnd: Concert) {
requestAndAppendData(query, itemAtEnd.key)
}