where should i need to make changes to make it infinite ?
Closed this issue · 1 comments
i am already using this lib from this source https://github.com/clkasd/CarouselViewProject/tree/master/src/net/infratek/CarouselView
this is working fine but the issue is now i want to make carousel infinite where should i need to make changes in order to make it as infinite carousel ?
i have just only changed "onPageScrolled" but still its not producing result and also app crashed becaue i m creating dynamic fragments
It's not actually "infinite" in this sample, the trick is return a VERY BIG number in getCount()
of your adapter, and then use modulo to return the same view after a few pages in getView()
, and then when after setAdapter()
you have to setCurrentItem()
to a half of aforementioned VERY BIG number.
That's it, for detailed implementation, take a look here: https://github.com/mrleolink/SimpleInfiniteCarousel/blob/master/src/net/leolink/android/simpleinfinitecarousel/MyPagerAdapter.java