None linear activity transition animation

413 views Asked by At

I want to implement a none linear activity transition animation.

My current anime xml file

<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate android:fromXDelta="100%p" android:toXDelta="0"
        android:duration="@android:integer/config_mediumAnimTime"/>
    <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
        android:duration="@android:integer/config_mediumAnimTime" />
</set>

What i want to do is animation to start slow end in faster speed.

1

There are 1 answers

2
Markus Rubey On BEST ANSWER

android:interpolator let's you manipulate the rate of change of an animation. If you want to starts out slowly and then accelerate use AccelerateInterpolator.

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
    android:fromXDelta="100%p"
    android:toXDelta="0"
    android:interpolator="@android:anim/accelerate_interpolator"
    android:duration="@android:integer/config_mediumAnimTime" />
<alpha
    android:fromAlpha="0.0"
    android:toAlpha="1.0"
    android:interpolator="@android:anim/accelerate_interpolator"
    android:duration="@android:integer/config_mediumAnimTime" />
</set>