I am trying to implement a simple gallery of images in which I have an image to be displayed at a time on the device screen. When we swipe the screen from left to right it shoul
I needed the same thing for my app, and used a ViewPager
:
http://blog.sqisland.com/2012/09/android-swipe-image-viewer-with-viewpager.html
Previously I used a ImageSwitcher
combined with a GestureDetector
: http://blog.sqisland.com/2012/07/android-swipe-image-viewer.html
The code with ViewPager
is much simpler, and the experience is much better because the image slides as your finger swipe across the screen. I create ImageView
directly, no fragments required.