Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tank777
Created July 3, 2017 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tank777/0496de195e1ae894d118c258b512e20e to your computer and use it in GitHub Desktop.
Save tank777/0496de195e1ae894d118c258b512e20e to your computer and use it in GitHub Desktop.
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