Track animations and flush them

Summary:
Changelog: [Internal]

Track delete animations and when `manageChildren` is called on a certain view tag, finish all pending deletion animations before manipulating children

Reviewed By: JoshuaGross

Differential Revision: D20319824

fbshipit-source-id: b594d0e6e9b6fecc5eca2938f284be631494e55c
This commit is contained in:
Luna Wei
2020-03-09 15:56:38 -07:00
committed by Facebook Github Bot
parent d3b93f7578
commit dedf9372ca
2 changed files with 43 additions and 1 deletions
@@ -363,6 +363,8 @@ public class NativeViewHierarchyManager {
@Nullable int[] tagsToDelete) {
UiThreadUtil.assertOnUiThread();
mLayoutAnimator.cancelAnimationsForViewTag(tag);
final ViewGroup viewToManage = (ViewGroup) mTagsToViews.get(tag);
final ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(tag);
if (viewToManage == null) {
@@ -445,6 +447,7 @@ public class NativeViewHierarchyManager {
if (mLayoutAnimationEnabled && mLayoutAnimator.shouldAnimateLayout(viewToDestroy)) {
mLayoutAnimator.deleteView(
tag,
viewToDestroy,
new LayoutAnimationListener() {
@Override