Reputation: 1394
I would like to create an animation in one of my activities that, when a button is clicked, the background "moves" to the next section of an image. A very good example of this is how Expedia Android app does this for creating a user. When create an expedia account is selected, the background animates to another section of the background image.
Any help on how to approach this problem would be greatly appreciated!
Upvotes: 0
Views: 291
Reputation: 1394
I have had some success using this library:
https://github.com/andraskindler/parallaxviewpager
Instead of changing the background when scrolling, I make it change when a button is clicked.
Upvotes: 0
Reputation: 4284
This can be done extending viewPager. Take a look at some of the github libraries for demo :
https://github.com/prolificinteractive/ParallaxPager
https://github.com/xgc1986/ParallaxPagerTransformer
https://github.com/MatthieuLJ/ViewPagerParallax
https://github.com/garrapeta/ParallaxViewPager
https://github.com/andraskindler/parallaxviewpager
Upvotes: 1