Search code examples
androidandroid-gallery

Android - Gallery with even number of images


I am using a Gallery object in my app and the size of the images is such that four seems to be the ideal number of images in the gallery at one time. Three results in too much space and five in too little.

The problem is that the gallery seems to focus on the center element and therefore I can't get the four images to fit on screen and any one time. Even if I scroll by hand as soon as the release the touch the layout adjust so that an image is in the center of the gallery.

How can I amend this ?

P.S: If the reply is "Write your own gallery..", I'd appreciate references to some pre-written galleries or sources.


Solution

  • I wrote my own Gallery. In fact, it is more of a PaginatedGallery similar to the one used on iPhone.

    Its part of my library at : https://github.com/sfarooq/PaginatedGallery