main Fragment Move Right At Animation - Android Animation

Android examples for Animation:Move Animation

Description

main Fragment Move Right At Animation

Demo Code


//package com.java2s;

import android.view.animation.Animation;
import android.view.animation.AnimationSet;

import android.view.animation.TranslateAnimation;

public class Main {
    public static Animation mainFragmentMoveRightAt(int from, int distance) {
        // TODO Auto-generated method stub
        AnimationSet animationSet = new AnimationSet(true);
        Animation step1 = new TranslateAnimation(Animation.ABSOLUTE, from
                - distance, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0,
                Animation.ABSOLUTE, 0);//from w ww  .  j  a v  a2  s.  com
        step1.setDuration(100);
        animationSet.addAnimation(step1);
        //      animationSet.setInterpolator(new BounceInterpolator());
        return animationSet;
    }
}

Related Tutorials