Android examples for Animation:Slide Animation
fragment Slide Right Out
//package com.java2s; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; import android.view.animation.TranslateAnimation; public class Main { public static TranslateAnimation fragmentSlideRightOut(int duration) { TranslateAnimation translateAnimation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f); translateAnimation.setInterpolator(new LinearInterpolator()); translateAnimation.setDuration(duration); translateAnimation.setFillAfter(true); return translateAnimation; }// ww w.ja v a 2 s . co m }