Search code examples
androidxmluser-interfaceparallax

Android Parallax Image


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! enter image description here enter image description here


Solution

  • 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