summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2016-03-11 20:25:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-03-11 20:25:21 +0000
commit5a705d0bbbd1f5eb117170c9c68399cc7b484b7a (patch)
treeccddec3760e725be69c96116f4cc1ddd3cfad68d /core/java/android
parentf4c3d9f4c2e759b47d3aa7afcc3cb6900e926cc9 (diff)
parentb199da785b0174a2addcf0c4c31304d005dc69e9 (diff)
Merge "Set end value immediately when start a 0-duration animation" into nyc-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/animation/ValueAnimator.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index 5ab2c1d491d7..663f297a7feb 100644
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -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
// frame after the start delay.
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);
+ }
}
}