Chapter 25. Advanced UI with Paging and Swiping
Paging is the act of moving from page to page, and, on Android, we do this by swiping a finger across the screen. The current page then transitions in a direction and speed to match the finger movement. It is a useful and practical way to navigate around an app, but perhaps even more than this, it is an extremely satisfying visual effect for the user. Also, like RecyclerView
, we can selectively load just the data required for the current page and perhaps the data for the previous and following pages in anticipation.
The Android API, as you would have come to expect, has a few solutions for achieving paging in a quite simple manner.
In this chapter, we will learn to do the following:
- Achieve paging and swiping with images like you might find in a photo gallery app
- Implement paging and swiping with
Fragment
-based layouts, giving the potential to offer our users the ability to swipe their way through a selection of entire user interfaces...