fragment Slide Left Out - Android Animation

Android examples for Animation:Slide Animation

Description

fragment Slide Left Out

Demo Code


//package com.java2s;
import android.view.animation.Animation;

import android.view.animation.LinearInterpolator;

import android.view.animation.TranslateAnimation;

public class Main {
    public static TranslateAnimation fragmentSlideLeftOut(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;
    }//from w w  w.  j  a va 2  s.  c  o  m
}

Related Tutorials