I want to swipe view pager in both direction with infinite rotations. For example When swipe right then 1->2->3->1->2. So on When swipe left then 1->3->2->1->3. So on
Asked
Active
Viewed 822 times
0
-
You can take reference from http://stackoverflow.com/questions/13668588/infinite-scrolling-image-viewpager – Drup Desai Jun 22 '16 at 06:59
1 Answers
3
There is a library maybe help you
dependencies {
compile 'com.antonyt.infiniteviewpager:library:1.0.0'
}
In your layout
<com.antonyt.infiniteviewpager.InfiniteViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
In your code, wrap your existing PagerAdapter with the InfinitePagerAdapter
PagerAdapter wrappedAdapter = new InfinitePagerAdapter(adapter);
viewPager.setAdapter(wrappedAdapter);
But this library just working when you have at least 4 pages. More info link github library

Fuyuba
- 191
- 1
- 8