2021年2月4日木曜日

Animator メモ

single object, single property → ObjectAnimator val animator = ObjectAnimator.ofFloat(view, View.ALPHA, 0f, 1f) single object, multiple property, parallel → PropertyValuesHolder + ObjectAnimator val scaleX = PropertyValuesHolder.ofFloat(View.SCALE_X, 4f) val scaleY = PropertyValuesHolder.ofFloat(View.SCALE_Y, 4f) val animator = ObjectAnimator.ofPropertyValuesHolder(view, scaleX, scaleY) single object, multiple property, sequential → ObjectAnimator + AnimatorSet val scaleX = ObjectAnimator.ofFloat(view, View.SCALE_X, 4f) val scaleY = ObjectAnimator.ofFloat(view, View.SCALE_Y, 4f) val set = AnimatorSet() set.playSequentially(scaleX, scaleY) multiple object, multiple property, parallel → ObjectAnimator +AnimatorSet val move = ObjectAnimator.ofFloat(view1, View.TRANSLATION_Y, 100f) val rotate = ObjectAnimator.ofFloat(view2, View.ROTATION, 360f) val set = AnimatorSet() set.playTogether(move, rotate) multiple object, multiple property, sequential → ObjectAnimator +AnimatorSet val move = ObjectAnimator.ofFloat(view1, View.TRANSLATION_Y, 100f) val rotate = ObjectAnimator.ofFloat(view2, View.ROTATION, 360f) val set = AnimatorSet() set.playSequentially(move, rotate)

0 件のコメント:

コメントを投稿