Android ViewPager Transition

669 Views Asked by At

here is a nice gif of what happened in flicker app in the bottom this site Great animations with PageTransformer

here is what happening and i'm interested in:

1) first the fliker logo is large

2) by sliding next page the log scale down and move with nice animation

3) at the end the logo scale down and move to center and also the button moving up

i tried to achieve this kind of effect with ViewPager.PageTransformer. the problem is i can't control animation flow with amount of sliding. my animation start after a complete slid to next page.

i created a simple animation like these: (every time tried one of them)

XML

<scale
        android:fromXScale="1.0"
        android:fromYScale="1.0"
        android:toXScale="0.3"
        android:toYScale="0.3"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="700"
        android:fillBefore="false" />

JAVA

TranslateAnimation trans = new TranslateAnimation(0, 0, logoText.getHeight() + coordinate[1], 0);
        trans.setDuration(1000);
        trans.setFillAfter(true);
        trans.setInterpolator(new AccelerateDecelerateInterpolator());

so how can i create effect like that gif?

0

There are 0 best solutions below