Android Image Gallery using ViewPager
Screen slides are transitions between one entire screen to another and are common with UIs like setup wizards or slideshows. This Android tutorial shows how to create image slideshow with ViewPager (provided as part of Android support library). ViewPager can animate screen slides automatically.
Here’s what a screen slide looks like – transition from one screen to the next:
In this Android Image Slideshow tutorial we will be doing the following,
- Create an image slideshow along with image description using ViewPager and display circle indicator to show the current position in the slideshow.
- Enclose ViewPager and circle indicator in a layout and provide a border.
- Retrieve and parse JSON (product information) from remote server and store it as list of products.
- Handle ViewPager item clicks to display product details in another fragment (ProductDetailFragment)
- Proper back navigation of fragments on back key pressed.
- Handle fragment orientation changes and retain the state of the fragment.