public void startSecondAnimation(View view) {
ObjectAnimator rotationXAnimation = ObjectAnimator.ofFloat(mView1, "rotationX", 0f, 25f);
ObjectAnimator alphaAnimation = ObjectAnimator.ofFloat(mView1, "alpha", 0.5f, 1f);
ObjectAnimator scaleXAnimation = ObjectAnimator.ofFloat(mView1, "scaleX", 0.8f, 1f);
ObjectAnimator scaleYAnimation = ObjectAnimator.ofFloat(mView1, "scaleY", 0.8f, 1f);
ObjectAnimator translationYAnimation = ObjectAnimator.ofFloat(mView1, "translationY", -0.1f * mView1.getHeight(), 0f);
ObjectAnimator rerotationXAnimation = ObjectAnimator.ofFloat(mView1, "rotationX", 25f, 0f);
rerotationXAnimation.setStartDelay(200);
ObjectAnimator translationYAnimation2 = ObjectAnimator.ofFloat(mView2, "translationY", 0, mView2.getHeight());
translationYAnimation2.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mView2.setVisibility(View.INVISIBLE);
}
});
AnimatorSet as = new AnimatorSet();
as.playTogether(rotationXAnimation, alphaAnimation, scaleXAnimation, scaleYAnimation,
translationYAnimation,
rerotationXAnimation, translationYAnimation2);
as.setDuration(200);
as.start();
}
ObjectAnimationActivity2.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:MaterialDesignDemo
作者:
评论列表
文章目录