Hi I am using the gallery for displaying images. But the gallery has an end. I don't want this behaviour; I want to repeat the images again and again on both sides of the gallery. Is there a way to display the gallery elements as a circle?
1 Answers
I wrote a tutorial on how to create circular gallery. Read it in my Blog Post here: http://evgeni-shafran.blogspot.com/2011/08/tutorial-custom-gallery-circular-and.html
Here is what i did:
In the adapter i used, i made him think he have a really big element count. and then each element position= position%element.lenght and then i made the first position in the middle.
so what happen is this: (lets do it for 3 elements, you can have what ever amount you like later) This is how the adapter see the elements:
1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3
now you tell him that the first element is in the middle:
1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,->1<-,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3
if you make it a really big number, the user can scroll a lot before getting to the end.
Hope it helped you.

- 146
- 7
-
If you answers consists purely of link to your own blog, then there is a reasonable change that eventually some of your answers will be flagged as spam. I would suggest that you might want to at least give a summary of the of the approach taken in your linked post, to avoid flags and to ensure than your answer is still useful here, if your blog moves / goes away... – forsvarir Aug 02 '11 at 07:56