fragment Slide Right In - Android Animation

Android examples for Animation:Slide Animation

Description

fragment Slide Right 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 fragmentSlideRightIn(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  w  w  . j ava2s.  co m
}

Related Tutorials