private void startNewSteadyAnim() {
final String propertyNameRotateX = "canvasRotateX";
final String propertyNameRotateY = "canvasRotateY";
PropertyValuesHolder holderRotateX = PropertyValuesHolder.ofFloat(propertyNameRotateX, canvasRotateX, 0);
PropertyValuesHolder holderRotateY = PropertyValuesHolder.ofFloat(propertyNameRotateY, canvasRotateY, 0);
steadyAnim = ValueAnimator.ofPropertyValuesHolder(holderRotateX, holderRotateY);
steadyAnim.setDuration(1000);
steadyAnim.setInterpolator(new BounceInterpolator());
steadyAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
canvasRotateX = (float) animation.getAnimatedValue(propertyNameRotateX);
canvasRotateY = (float) animation.getAnimatedValue(propertyNameRotateY);
}
});
steadyAnim.start();
}
ClockView.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:MiClockView
作者:
评论列表
文章目录