Android carousel image gallery

How can I view the carousel image gallery that never ends ... after the last first image and before the first last image.

+2


a source to share


1 answer


I did this by creating my own adapter list (subclasses from BaseAdapter). I have coded my own adapter list so that its getCount () method returns the HUUUUGE number. And if the item "x" is selected, this item corresponds to the adapter position = 'adapter.getCount () / 2 + x' And for my adapter the getItem (int position) method, I look in my array which reserves the adapter and retrieves the item by index: (position-getCount () / 2)% myDataItems.length You need to do a few more "special" things for this to work properly, but you get the idea. Basically, it is still possible to reach the end or the beginning of the list, but if you set getCount () to about a million or so, this is Hard to do :-)



+1


a source







All Articles