@OnClick(R.id.btn_start)
public void onAction() {
// float start = mView.getY();
// if (start > 680f) {
// start = 0f;
// mView.setY(0f);
// }
// Keyframe kf0 = Keyframe.ofFloat(0f, 0f);
// Keyframe kf1 = Keyframe.ofFloat(.5f, 360f);
// Keyframe kf2 = Keyframe.ofFloat(1f, 0f);
// PropertyValuesHolder pvh = PropertyValuesHolder.ofKeyframe("X", kf0, kf1, kf2);
// ObjectAnimator anim = ObjectAnimator.ofPropertyValuesHolder(mView, pvh);
//
// anim.setDuration(5000);
// anim.setInterpolator(new AccelerateDecelerateInterpolator());
// anim.start();
ObjectAnimator animX = ObjectAnimator.ofFloat(mView, "x", 0, 50f);
ObjectAnimator animY = ObjectAnimator.ofFloat(mView, "y", 0, 100f);
AnimatorSet animSetXY = new AnimatorSet();
animSetXY.playTogether(animX, animY);
animSetXY.setInterpolator(new CycleInterpolator(0.5f));
animSetXY.start();
}
FrameFragment.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:AndroidAnimationDemo
作者:
评论列表
文章目录