What my code does:
Here\'s my code which for viewpager that swipes between xml layouts (named left.xml, right.xml and center.xml).
W
I think one option would be to insert each image into its own layout with an ImageView and then inflate the layout that the image is in rather than the image itself.