In the maybeDropAncestors function we can remove the view if it has no remaining animating views. Let's say we have nested exiting animations:
flowchart TD
A((A: EXITING))
B((B: EXITING))
C((C: WAITING))
D((D: WAITING))
E((E: WAITING))
A --> B
A --> C
A --> D
A --> E
In the current implementation in this case if the animation in B ended before A, we would visit A in maybeDropAncestors and decided to remove A, even though it still has some waiting children. Then A would be added to the view recycling pool while still having children. This would cause us to see some zombie views when the view is reused.
I changed the maybeDropAncestors condition to check the size of the children list. I also removed node->animatedChildren as I think it is no longer necessary.
Fixes #6644
Test plan
Chceck [LA] View recycling example, if there are no zombie views in the WheelPicker component.
Summary
In the
maybeDropAncestors
function we can remove the view if it has no remaining animating views. Let's say we have nested exiting animations:In the current implementation in this case if the animation in
B
ended beforeA
, we would visitA
inmaybeDropAncestors
and decided to removeA
, even though it still has some waiting children. ThenA
would be added to the view recycling pool while still having children. This would cause us to see some zombie views when the view is reused.I changed the
maybeDropAncestors
condition to check the size of thechildren
list. I also removednode->animatedChildren
as I think it is no longer necessary.Fixes #6644
Test plan
Chceck
[LA] View recycling
example, if there are no zombie views in theWheelPicker
component.