main Fragment Move Left Animation - Android Animation

Android examples for Animation:Move Animation

Description

main Fragment Move Left Animation

Demo Code


//package com.java2s;

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

import android.view.animation.TranslateAnimation;

public class Main {
    static public Animation mainFragmentMoveLeft(int distance) {

        AnimationSet animationSet = new AnimationSet(true);
        Animation step1 = new TranslateAnimation(Animation.ABSOLUTE,
                distance, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0,
                Animation.ABSOLUTE, 0);//from  ww w  .  ja va 2 s  .co m
        step1.setDuration(400);
        step1.setInterpolator(new LinearInterpolator());
        animationSet.addAnimation(step1);
        animationSet.setInterpolator(new BounceInterpolator());
        return animationSet;

    }
}

Related Tutorials