What i need to do is to create a horizontal pipeline in the middle of the Screen in which images are being populated. It is just like a moving horizontal pager.
The difficulty is that i am still seeking for an idea to bring horizontal scroll as a circular Image Slider.
However when it displays the last image, the very first one should be next in queue.
Can anybody provide any logic to do so.
Thanks very much.
There is no standard widget available for that i am sorry, you will need to get some open source implementations of what you need. You can find may on the net, pick one decently documented a work on it.
Just set Your Array index to zero when it reaches at the last index while sliding the images.
your best option is to implement a Gallery (or the EcoGallery, if you find it online) or a Pager.
For that ViewGroup you'll use an CustomAdapter that extends BaseAdapter but uses an ArrayList<>
to hold your data. For getCount()
should return Integer.MAX_VALUE
. As soon as you call setAdapter()
on you the ViewGroup, you should also call setCurrent(Integer.MAX_VALUE/2);
(or something similar to that, really depends on which ViewGroup you will use.
and finally, in your getView you should put while(position > mArray.size()) position = position - mArray.size();
Then you can generate the view normally.
That will not be a true circular (as the user can end up in the 0 or Integer.MAX_VALUE, but it will be VERY difficult for a user to get that far.