This problem has ben bugging me for longer than I am willing to admit, so I came here for help.
I am, AFAIK, restrained to using a FragmentStatePagerAdapter to display my fragments due to bitmaps and OOMs on Android.
I am implementing a game, and I have a set of fragments. Some of these fragments can be locked, and should thus not be shown when swiping through the list.
For instance:
I have a set containing 1..10 fragments. In this set, fragment #5,#6 and #7 are locked. This means I have two subsets (1..4 and 8..10) of unlocked fragments.
The functionality I'd like to have, is to swipe from #1 to #4 and to swipe from #8 to #10.
It should not be able to swipe from #4 to #5, and it should not be possible to swipe between the two subsets.
When displaying fragment #4, it should function as if #4 was the end of the list. Accordingly, when displaying #8, it should appear as #8 is at the start of the list when being in the other subset.
Is there any suggestions? I have tried to override the getItem and passing in subsets, which has mainly resulted in either NPEs or displaying wrong fragments.