finished activity: MainActivity

This commit is contained in:
free will
2021-07-16 10:10:16 +08:00
parent 86aa515da6
commit b587210488
3 changed files with 127 additions and 1 deletions
@@ -144,6 +144,17 @@ fun View.animer(vararg animations: ObjectAnimator) {
animatorSet.start()
}
fun View.animer2(vararg animations: ObjectAnimator) {
if (animations.isEmpty())
return
val animatorSet = AnimatorSet()
val builder = animatorSet.setDuration(1000)
.play(animations[0])
animations.filterIndexed { index, _ -> index != 0 }
.forEach { builder.with(it) }
animatorSet.start()
}
/**
* 平移旋转渐变组合动画
*/