fragment Slide Left In - Android Animation

Android examples for Animation:Slide Animation

Description

fragment Slide Left In

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 fragmentSlideLeftIn(int duration) {
        TranslateAnimation translateAnimation = new TranslateAnimation(
                Animation.RELATIVE_TO_SELF, -1f,
                Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,
                0f, Animation.RELATIVE_TO_SELF, 0f);
        translateAnimation.setInterpolator(new LinearInterpolator());
        translateAnimation.setDuration(duration);
        translateAnimation.setFillAfter(true);

        return translateAnimation;
    }/*from  w  ww  .jav a2 s . com*/
}

Related Tutorials