ToxicBakery / ViewPagerTransforms

Library containing common animations needed for transforming ViewPager scrolling for Android v13+.
https://toxicbakery.github.io/ViewPagerTransforms/
Apache License 2.0
2.57k stars 487 forks source link

1 to 3 Transformer #20

Closed ppamorim closed 9 years ago

ppamorim commented 9 years ago

Hi, I need a transformer mode that's allow the "slide" from page 1 to page 3... from page 2 to page 10... Anyone can help?

ToxicBakery commented 9 years ago

You want to see animation for all the slides between the current position and position 'X'. Is that correct?

ppamorim commented 9 years ago

Yes! Well, I will explain: Actually, the animations run like this: [1] -> [2] -> [3]

I need recreate this: [1] --------> [3]

ToxicBakery commented 9 years ago

This library is only for animation of transitions between pages in a ViewPager and does not have any way to control the content of function of a ViewPager. PagerAdapter implementations directly control what content is shown and when, based on input from the ViewPager to move between positions in the underlying adapters source data.

If you want traverse non linearly in your ViewPager, you will have to create your own ViewPager implementation that instructs the PagerAdapter to move to the next desired page and not the next linear order page.

ToxicBakery commented 9 years ago

Alternately, you could reorder the data in the underlying PagerAdapter. This would also potentially do what you want but its probably not a great idea. A custom ViewPager is likely a more sane approach.