Exploring pagination with Jetpack Paging
To implement an infinite list of repositories in our Repositories App, we must find a way to request more repositories as the user scrolls through the existing list and reaches its bottom, thereby adding new elements on the fly. Instead of manually deciding when the user is approaching the bottom of the current list of repositories and then triggering a network request to get new items, we can use the Jetpack Paging library, which hides all this complexity from us.
Jetpack Paging is a library that helps us load and display pages of data from a large set of data, either through network requests or from our local data storage, thereby allowing us to save network bandwidth and optimize the usage of system resources.
In this chapter, for simplicity, we will use the Paging library to display an infinite list of repositories obtained from a network source (that is, the GitHub Search API), without involving the local cache.
Note
The Jetpack...