Android 常用动画

参考:

https://blog.csdn.net/qq_40881680/article/details/82381258

// 移动 带有动画效果
final AnimatorSet animatorSet = new AnimatorSet();
masterVideoLayout.setPivotX(0.0f);// 左上角
masterVideoLayout.setPivotY(0.0f);

// 同时执行移动,放大动画
animatorSet.playTogether(
		ObjectAnimator.ofFloat(masterVideoLayout,"translationX",0f,-wW).setDuration(300),
		ObjectAnimator.ofFloat(masterVideoLayout,"scaleX",3).setDuration(300),
		ObjectAnimator.ofFloat(masterVideoLayout,"scaleY",2).setDuration(300));
animatorSet.start();

// 单个执行
objectAnimator = ObjectAnimator.ofFloat(image,"translationX",0f,60f,0f);
objectAnimator.setDuration(2000);
objectAnimator.start();

 

发表评论

zh_CNChinese
zh_CNChinese