How can i carousel image gallery which never gets end.. after last first image and before first last image.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I did this by creating my own list-adapter (subclassed from
BaseAdapter).
I coded my own list-adapter in such a way that its getCount() method
returns a HUUUUGE number.
And if item ‘x’ is selected, then this item corresponds to adapter
position=’adapter.getCount()/2+x’
And for my adapter’s method getItem(int position), i look in my array
that backs up the adapter and fetch the item on index:
(position-getCount()/2) % myDataItems.length
You need to do some more ‘special’ stuff to make it all work
correctly, but you get the idea.
In principle, it is still possible to reach the end or the beginning
of the list, but if you set getCount() to around a million or so, this
is hard to do 🙂