I am using a ViewPager
with the FragmentStatePagerAdapter
to allow navigation between some fragments.
Let's say I have three fragments: A
, B
and C
. The ViewPager shows Fragment A initially, and allows you to navigate to Fragment B by swiping from right-to-left, and then to Fragment C by swiping again. This allows the following navigation paths: A <--> B <--> C
.
What I would like is to be able to swipe from left-to-right on Fragment A and have the ViewPager show Fragment C, i.e. for it to behave as a circular queue and allow ... --> C <--> A <--> B <--> C <--> A <-- ...
I do not want the Fragments duplicated in other positions (i.e. ending up with more than three instances).
Is this wrapping functionality possible with a ViewPager?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…