水波纹动画

X,Y轴放大,透明度减少

1
2
3
4
5
6
7
8
9
10
11
12
13
14
private AnimationSet initAnimationSet() {
AnimationSet animSet = new AnimationSet(true);
ScaleAnimation scaleAnim = new ScaleAnimation(1f, 1.2f, 1f, 1.2f,
ScaleAnimation.RELATIVE_TO_SELF, 0.5f,
ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
scaleAnim.setDuration(DURATION_ANIMATOR);
scaleAnim.setRepeatCount(Animation.INFINITE);// 设置循环
AlphaAnimation alphaAnim = new AlphaAnimation(1f, 0f);
alphaAnim.setDuration(DURATION_ANIMATOR);
alphaAnim.setRepeatCount(Animation.INFINITE);//设置循环
animSet.addAnimation(scaleAnim);
animSet.addAnimation(alphaAnim);
return animSet;
}