Google released the ViewPager2
and replaces the original ViewPager. Since this project is based on the old ViewPager, this repository is now read-only. If you want to have in "infinite" implementation of ViewPager2
, you can check out Infinite-ViewPager2
.
Thank you everyone for using this library.
InfiniteViewPager is a modified ViewPager that allows infinite paging.
Bind it in your layout:
<com.thehayro.view.InfiniteViewPager
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
Setup the adapter:
public class MyInfinitePagerAdapter<T> extends InfinitePagerAdapter { // ...
}
And initialize with any init value:
MyInfinitePagerAdapter<Integer> adapter =
new MyInfinitePagerAdapter<Integer>(0);
Bind the adapter to the InfiniteViewPager with:
// ...
InfiniteViewPager pager = (InfiniteViewPager) findViewById(R.id...);
pager.setAdapter(adapter);
Also see website for further details.
- 0.4.1 fix #1 (thanks to RogerParis)
- 0.4 added OnInfinitePageChangeListener
- 0.3 fixed some errors
- 0.2 Added custom 'setCurrentItem()'
- 0.1 initial release
Apache Licence