File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
core/java/android/animation Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -420,11 +420,7 @@ public AnimatorSet setDuration(long duration) {
420420 if (duration < 0 ) {
421421 throw new IllegalArgumentException ("duration must be a value of zero or greater" );
422422 }
423- for (Node node : mNodes ) {
424- // TODO: don't set the duration of the timing-only nodes created by AnimatorSet to
425- // insert "play-after" delays
426- node .animation .setDuration (duration );
427- }
423+ // Just record the value for now - it will be used later when the AnimatorSet starts
428424 mDuration = duration ;
429425 return this ;
430426 }
@@ -456,6 +452,14 @@ public void start() {
456452 mTerminated = false ;
457453 mStarted = true ;
458454
455+ if (mDuration >= 0 ) {
456+ // If the duration was set on this AnimatorSet, pass it along to all child animations
457+ for (Node node : mNodes ) {
458+ // TODO: don't set the duration of the timing-only nodes created by AnimatorSet to
459+ // insert "play-after" delays
460+ node .animation .setDuration (mDuration );
461+ }
462+ }
459463 // First, sort the nodes (if necessary). This will ensure that sortedNodes
460464 // contains the animation nodes in the correct order.
461465 sortNodes ();
You can’t perform that action at this time.
0 commit comments