Merge "Set end value immediately when start a 0-duration animation" into nyc-dev
am: 5a705d0bbb
* commit '5a705d0bbbd1f5eb117170c9c68399cc7b484b7a':
Set end value immediately when start a 0-duration animation
This commit is contained in:
@@ -972,7 +972,14 @@ public class ValueAnimator extends Animator implements AnimationHandler.Animatio
|
|||||||
// to be consistent with the previous behavior. Otherwise, postpone this until the first
|
// to be consistent with the previous behavior. Otherwise, postpone this until the first
|
||||||
// frame after the start delay.
|
// frame after the start delay.
|
||||||
startAnimation();
|
startAnimation();
|
||||||
setCurrentFraction(mSeekFraction == -1 ? 0 : mSeekFraction);
|
if (mSeekFraction == -1) {
|
||||||
|
// No seek, start at play time 0. Note that the reason we are not using fraction 0
|
||||||
|
// is because for animations with 0 duration, we want to be consistent with pre-N
|
||||||
|
// behavior: skip to the final value immediately.
|
||||||
|
setCurrentPlayTime(0);
|
||||||
|
} else {
|
||||||
|
setCurrentFraction(mSeekFraction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user