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 :-)



On Dec 17, 5:46 am, Mart <[email protected]> wrote:
> Hi, I want to create a customized ListView (or similar) which will
> behave like a closed (circular) one:
>
>    1. scrolling down - after the last item was reached the first
> begins  (.., n-1, n, 1, 2, ..)
>    2. scrolling upward - after the first item was reached the last
> begins (.., 2, 1, n, n-1, ..)
>
> It sounds simple conceptually but, apparently, there is no
> straightforward approach to do this.
> Can anyone point me to the right solution ?
> Thank you !

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to