Create TranslateAnimation - Android android.view.animation

Android examples for android.view.animation:Translate Animation

Description

Create TranslateAnimation

Demo Code

import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;

public class Main{

    public static Animation getInAnim() {
        Animation inFromRight = new TranslateAnimation(Animation.ABSOLUTE,
                +320.0f, Animation.ABSOLUTE, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f);
        inFromRight.setDuration(850);//from   ww w  .j  a  v a  2s  . com
        inFromRight.setInterpolator(new AccelerateDecelerateInterpolator());
        return inFromRight;
    }

}

Related Tutorials