public static void animateProperty(final View view, Animator.AnimatorListener animationListener) {
/*ObjectAnimator a1 = ObjectAnimator.ofFloat(view, "scaleX", 1.1f, 1f);
ObjectAnimator a2 = ObjectAnimator.ofFloat(view, "translationY", 575f, 0f);
AnimatorSet set = new AnimatorSet();
set.setDuration(150);
set.playTogether(a1, a2);
//set.setStartDelay(100);
//set.playSequentially(a1,a2,a3);
//set.play(a1).with(a2);
//set.play(a3).after(a2);
set.start();*/
PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("scaleX", 1.1f, 1f);
PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("translationY", 575f, 0f);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(view, pvhX, pvhY).setDuration(150);
animator.addListener(animationListener);
animator.start();
}
属性动画
最新推荐文章于 2024-09-14 00:36:28 发布