There is one use-case of ViewPager
I've never seen pretty implemented.
ViewPager
is more or less static structure. It's not so hard to add Pages to the right side (appending to Model and displaying it), however, there should be nice-to-use solution to expand PagerAdapter (or some of it's subclasses) so it can expand in both directions.
I can imagine interface for Adapter like this
boolean isEmpty()
boolean hasNext()
boolean hasPrevious()
Object getNext()
Object getPrevious()
Object getItem(int position)
// or if using generics
T getNext()
T getPrevious()
T getItem(int position)
Similar to Collections Iterator, but both-directional.
Where index/position is not limited from below on 0, but can use whole range of Integer type.
Maybe not base the implementation on array (which is 0 to infinite).
I've found this "hack": dynamically add and remove view to viewpager
But as I stated before, I'm trying to get it working naturally, not maintaining 3,5,... items and force ViewPager to change current position based on some twisted logic
Is there currently any sufficient implementation or is it necessary to implement it?
I'm willing to bounty reward answer, if it will be a whole new implementation.