From c0ac0d5071351bdd613222cbff41041746420870 Mon Sep 17 00:00:00 2001 From: Olivier Notteghem Date: Wed, 8 Jun 2016 08:09:31 -0700 Subject: [PATCH] Fix missing check causing layout some animation code to be executed when it shouldn't Reviewed By: dmmiller Differential Revision: D3404149 fbshipit-source-id: 8663325fd3a4b9257d84075e22bd9cc59d6414ac --- .../react/uimanager/NativeViewHierarchyManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java index f6e13761a1c397..7ffe35967226c7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java @@ -348,7 +348,8 @@ public void manageChildren( View viewToRemove = viewManager.getChildAt(viewToManage, indexToRemove); - if (mLayoutAnimator.shouldAnimateLayout(viewToRemove) && + if (mLayoutAnimationEnabled && + mLayoutAnimator.shouldAnimateLayout(viewToRemove) && arrayContains(tagsToDelete, viewToRemove.getId())) { // The view will be removed and dropped by the 'delete' layout animation // instead, so do nothing @@ -395,7 +396,8 @@ public void manageChildren( tagsToDelete)); } - if (mLayoutAnimator.shouldAnimateLayout(viewToDestroy)) { + if (mLayoutAnimationEnabled && + mLayoutAnimator.shouldAnimateLayout(viewToDestroy)) { mLayoutAnimator.deleteView(viewToDestroy, new LayoutAnimationListener() { @Override public void onAnimationEnd() {