AnimatorSet的持续时间与Object / ValueAnimator的持续时间有什么区别?

时间:2019-04-23 19:24:56

标签: android animation kotlin animator animatorset

我有一个带有两个ObjectAnimators的AnimatorSet。我看不到他们的持续时间之间的差异。谁能向我解释一下?

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:ordering="together">
    <objectAnimator
        android:propertyName="translationY"
        android:duration="1000"
        android:interpolator="@android:interpolator/bounce"
        android:repeatCount="3"
        android:valueFrom="0.0"
        android:valueTo="-600.0"
        android:repeatMode="reverse"
        android:valueType="floatType"/>
    <objectAnimator
        android:propertyName="alpha"
        android:duration="1000"
        android:interpolator="@android:interpolator/linear"
        android:repeatCount="3"
        android:valueFrom="1.0"
        android:valueTo="0.0"
        android:repeatMode="reverse"
        android:valueType="floatType"
        />
</set>

val rocketAnimatorSet = AnimatorInflater.loadAnimator(this, R.animator.jump_and_blink) as AnimatorSet
    val dogeAnimatorSet = AnimatorInflater.loadAnimator(this, R.animator.jump_and_blink) as AnimatorSet

    rocketAnimatorSet.setTarget(rocket)
    dogeAnimatorSet.setTarget(doge)


    val animatorSet = AnimatorSet()
    animatorSet.playTogether(rocketAnimatorSet, dogeAnimatorSet)
    animatorSet.duration =9000L
    animatorSet.start()

0 个答案:

没有答案