Using Swipe Views to swop pages
Swipe views allow you to change pages by swiping your finger across the screen.
You create Swipe views by using a page viewer and an adapter. The adapter supplies the pages and the page viewer takes care of moving the pages on and off the screen.
We’re using a ViewPager. It’s a layout manager that takes care of the horizontal scrolling. Usually it’s used with fragments, scrolling them on and off screen.
We’re also going to need a page adapter to supply the pages to the ViewPager.
As we’re using fragments, we have two adapter options:
We’re going to use the FragmentStatePagerAdapter.