Here you can find the source of mainFragmentBackFromRight(int distance)
static public Animation mainFragmentBackFromRight(int distance)
//package com.java2s; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.BounceInterpolator; import android.view.animation.TranslateAnimation; public class Main { static public Animation mainFragmentBackFromRight(int distance) { AnimationSet animationSet = new AnimationSet(true); Animation step1 = new TranslateAnimation(Animation.ABSOLUTE, distance, Animation.ABSOLUTE, 720, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0);// www .ja va 2s .c o m step1.setDuration(200); Animation step2 = new TranslateAnimation(Animation.ABSOLUTE, 100, Animation.ABSOLUTE, -720, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0); step2.setDuration(400); animationSet.addAnimation(step1); animationSet.addAnimation(step2); animationSet.setInterpolator(new BounceInterpolator()); return animationSet; } }