安卓(Android) 怎么获取放大动画(Animation)

2019年10月16日22:56:00安卓(Android) 怎么获取放大动画(Animation)已关闭评论 179 905字阅读3分1秒

1.简介

安卓(Android) 怎么获取放大动画(Animation)?——请看下文。

2.示例代码

/**
 * 版权所有 编程十万个怎么办(www.tah1986.com)
 */


 


import android.view.animation.Animation.AnimationListener;

import android.view.animation.ScaleAnimation;

public class Main {

    public static final long DEFAULT_ANIMATION_DURATION = 400;

    public static ScaleAnimation getAmplificationAnimation(
            long durationMillis, AnimationListener animationListener) {
        ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f,
                0.0f, 1.0f, ScaleAnimation.RELATIVE_TO_SELF,
                ScaleAnimation.RELATIVE_TO_SELF);
        scaleAnimation.setDuration(durationMillis);
        scaleAnimation.setAnimationListener(animationListener);
        return scaleAnimation;
    }

    public static ScaleAnimation getAmplificationAnimation(
            long durationMillis) {
        return getAmplificationAnimation(durationMillis, null);

    }

    public static ScaleAnimation getAmplificationAnimation(
            AnimationListener animationListener) {
        return getAmplificationAnimation(DEFAULT_ANIMATION_DURATION,
                animationListener);

    }
}

 
继续阅读
编程十万个怎么办