1

I have found solution for standard view pager Disable ViewPager scrolling animation But my view pager is already transformed to:

public void transformPage(View view, float position) { int width = view.getWidth(); int height = view.getHeight(); if (position < -1) { view.setAlpha(0); } else if (position <= 1) { view.setTranslationY(height * position); view.setTranslationX(width * -position); } else { view.setAlpha(0); } } 

How is it possible to transform further to achieve depth scroll animation?

1 Answer 1

0
 viewPager.setPageTransformer(false, new PageTransformer() { @Override public void transformPage(View view, float position) { if (position <= -1.0F) { view.setAlpha(0); } else if (position < 0F) { view.setAlpha(1); view.setTranslationX((int) ((float) (view.getWidth()) * -position)); } else if (position >= 0F) { view.setAlpha(1); } else if (position > 1.0F) { view.setAlpha(0); } } }); 

I did it this way. Hope it helps some one.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.