get Translate X from 100 To 0 Animation - Android Animation

Android examples for Animation:Translate Animation

Description

get Translate X from 100 To 0 Animation

Demo Code


//package com.java2s;
import android.view.View;

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

public class Main {
    private static TranslateAnimation getTranslateX100To0Animation(
            View view, long duration) {
        TranslateAnimation animation = new TranslateAnimation(
                Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF,
                0, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0);
        animation.setDuration(duration);
        return animation;
    }/*from   ww  w. j a  v a 2 s  .c o  m*/
}

Related Tutorials