Created
July 3, 2017 16:38
-
-
Save tank777/0496de195e1ae894d118c258b512e20e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VerticalTransformer implements ViewPager.PageTransformer { | |
private float yPosition; | |
@Override | |
public void transformPage(View view, float position) { | |
view.setTranslationX(view.getWidth() * -position); | |
yPosition = position * view.getHeight(); | |
view.setTranslationY(yPosition); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment