summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-04-12 12:02:13 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-12 12:02:13 -0700
commit793807fff1e65d9049a1bea0a582e6edc1b80dde (patch)
treebe569f0bce21265e675abcd8a4f2f32b41d9f9ea /core/java
parentdecd3039ca71e5340ec01027170941637bf9876e (diff)
parentc299a3384171e36fc9ab6d1011d8a589a7f344d1 (diff)
downloadframeworks_base-793807fff1e65d9049a1bea0a582e6edc1b80dde.zip
frameworks_base-793807fff1e65d9049a1bea0a582e6edc1b80dde.tar.gz
frameworks_base-793807fff1e65d9049a1bea0a582e6edc1b80dde.tar.bz2
Merge "Fix AnimatorSet duration issue"
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/animation/AnimatorSet.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java
index c5a4171..f9fa444 100644
--- a/core/java/android/animation/AnimatorSet.java
+++ b/core/java/android/animation/AnimatorSet.java
@@ -420,11 +420,7 @@ public final class AnimatorSet extends Animator {
if (duration < 0) {
throw new IllegalArgumentException("duration must be a value of zero or greater");
}
- for (Node node : mNodes) {
- // TODO: don't set the duration of the timing-only nodes created by AnimatorSet to
- // insert "play-after" delays
- node.animation.setDuration(duration);
- }
+ // Just record the value for now - it will be used later when the AnimatorSet starts
mDuration = duration;
return this;
}
@@ -456,6 +452,14 @@ public final class AnimatorSet extends Animator {
mTerminated = false;
mStarted = true;
+ if (mDuration >= 0) {
+ // If the duration was set on this AnimatorSet, pass it along to all child animations
+ for (Node node : mNodes) {
+ // TODO: don't set the duration of the timing-only nodes created by AnimatorSet to
+ // insert "play-after" delays
+ node.animation.setDuration(mDuration);
+ }
+ }
// First, sort the nodes (if necessary). This will ensure that sortedNodes
// contains the animation nodes in the correct order.
sortNodes();