Merge "Fix leak in LayoutTransition" into ics-mr1

This commit is contained in:
Chet Haase
2011-11-10 17:33:31 -08:00
committed by Android (Google) Code Review

View File

@@ -657,6 +657,15 @@ public class LayoutTransition {
*/ */
private void setupChangeAnimation(final ViewGroup parent, final int changeReason, private void setupChangeAnimation(final ViewGroup parent, final int changeReason,
Animator baseAnimator, final long duration, final View child) { Animator baseAnimator, final long duration, final View child) {
// If we already have a listener for this child, then we've already set up the
// changing animation we need. Multiple calls for a child may occur when several
// add/remove operations are run at once on a container; each one will trigger
// changes for the existing children in the container.
if (layoutChangeListenerMap.get(child) != null) {
return;
}
// Make a copy of the appropriate animation // Make a copy of the appropriate animation
final Animator anim = baseAnimator.clone(); final Animator anim = baseAnimator.clone();