get New Animation Set from ScaleAnimation, AlphaAnimation - Android Animation

Android examples for Animation:Scale Animation

Description

get New Animation Set from ScaleAnimation, AlphaAnimation

Demo Code


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

public class Main {
    public static AnimationSet getNewAnimationSet() {
        AnimationSet animationset = new AnimationSet(true);
        ScaleAnimation scaleanimation = new ScaleAnimation(1.0F, 1.8F,
                1.0F, 1.8F, 1, 0.5F, 1, 0.5F);
        scaleanimation.setDuration(900L);
        scaleanimation.setRepeatCount(-1);
        AlphaAnimation alphaanimation = new AlphaAnimation(1.0F, 0.1F);
        alphaanimation.setRepeatCount(-1);
        animationset.setDuration(900L);//  w  w w.ja  v a 2  s . c  om
        animationset.addAnimation(scaleanimation);
        animationset.addAnimation(alphaanimation);
        return animationset;
    }
}

Related Tutorials