@Override
public SkinAnimator apply(@NonNull View view, @Nullable final Action action) {
this.targetView = view;
preAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
PropertyValuesHolder.ofFloat("ScaleX",
1, 0),
PropertyValuesHolder.ofFloat("ScaleY",
1, 0))
.setDuration(PRE_DURATION * 3);
preAnimator.setInterpolator(new LinearInterpolator());
afterAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
PropertyValuesHolder.ofFloat("ScaleX",
0, 1),
PropertyValuesHolder.ofFloat("ScaleY",
0, 1))
.setDuration(AFTER_DURATION * 2);
afterAnimator.setInterpolator(new OvershootInterpolator());
preAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (action != null) {
action.action();
}
afterAnimator.start();
}
});
return this;
}
ScaleAnimator.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:AndroidSkinAnimator
作者:
评论列表
文章目录