Code example for AnimationSet

Methods: addAnimation

0
public class AnimationFactory { 
 
    public static final String TAG = AnimationFactory.class.getSimpleName();
 
    public static Animation getSlideInLeftAnimation(final long duration) {
	final AnimationSet set = new AnimationSet(true);
	set.addAnimation(getTranslateAnimation(duration, 1.0f, 0.0f, 0.0f, 0.0f));
	set.addAnimation(getAlphaAnimationFadeIn(duration));
	return set;
    } 
 
    public static Animation getSlideInRightAnimation(final long duration) {
	final AnimationSet set = new AnimationSet(true);
	set.addAnimation(getTranslateAnimation(duration, -1.0f, 0.0f, 0.0f, 0.0f));
	set.addAnimation(getAlphaAnimationFadeIn(duration));
	return set;
    } 
 
    public static Animation getSlideOutRightAnimation(final long duration) {
	final AnimationSet set = new AnimationSet(true);
	set.addAnimation(getTranslateAnimation(duration, 0.0f, 1.0f, 0.0f, 0.0f));