当前位置 : 主页 > 编程语言 > c++ >

Android动画工具类

来源:互联网 收集:自由互联 发布时间:2021-06-30
AnimationUtil.java import android.view.View;import android.view.animation.AlphaAnimation;public class AnimationUtil {public static void showAlphaAnimation(View v, long durationMillis) {AlphaAnimation animation = new AlphaAnimation(0, 1);ani
AnimationUtil.java
import android.view.View;
import android.view.animation.AlphaAnimation;

public class AnimationUtil {
	public static void showAlphaAnimation(View v, long durationMillis) {
		AlphaAnimation animation = new AlphaAnimation(0, 1);
		animation.setDuration(durationMillis);
		v.startAnimation(animation);
	}

	public static void hideAlphaAnimation(View v, long durationMillis) {
		AlphaAnimation animation = new AlphaAnimation(1, 0);
		animation.setDuration(durationMillis);
		v.startAnimation(animation);
	}
}
网友评论