/**
* 启动动画 回弹效果
*
*/
private void startBackAnimator() {
PropertyValuesHolder xValuesHolder = PropertyValuesHolder.ofFloat("x", canvasRotateX, 0);
PropertyValuesHolder yValuesHolder = PropertyValuesHolder.ofFloat("y", canvasRotateY, 0);
touchAnimator = ValueAnimator.ofPropertyValuesHolder(xValuesHolder, yValuesHolder).setDuration(700);
touchAnimator.setInterpolator(new BounceInterpolator());
touchAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
canvasRotateY = (Float) animation.getAnimatedValue("y");
canvasRotateX = (Float) animation.getAnimatedValue("x");
invalidate();
}
});
touchAnimator.start();
}
SafeView.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:SafeView
作者:
评论列表
文章目录