Create Animation Set - Android Animation

Android examples for Animation:Animation Creation

Description

Create Animation Set

Demo Code


//package com.java2s;
import java.util.List;
import android.view.View;

import android.view.animation.Animation;
import android.view.animation.AnimationSet;

public class Main {

    public static AnimationSet initAnimationSet(View view,
            List<Animation> animations, int duration) {
        if (animations == null) {
            return null;
        }//from   w w  w . ja  va  2 s.c  o m
        AnimationSet set = new AnimationSet(true);

        for (Animation animation : animations) {
            set.addAnimation(animation);
        }
        set.setDuration(duration);
        view.startAnimation(set);
        return set;
    }
}

Related Tutorials