Android examples for Animation:Move Animation
main Fragment Move Right Animation
//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 mainFragmentMoveRight(int distance) { AnimationSet animationSet = new AnimationSet(true); Animation step1 = new TranslateAnimation(Animation.ABSOLUTE, -distance, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0);// w w w .j av a 2 s . c o m step1.setDuration(400); step1.setInterpolator(new LinearInterpolator()); animationSet.addAnimation(step1); animationSet.setInterpolator(new BounceInterpolator()); return animationSet; } }