Back out "[RN] Fix layout animation crash"

Summary: Original commit changeset: 41200e572ed7

Reviewed By: mdvacca

Differential Revision: D15485156

fbshipit-source-id: d0868a03b7186bb33998afc2c99dd85f31c8fef9
This commit is contained in:
Luna Wei
2019-05-28 09:09:07 -07:00
committed by Facebook Github Bot
parent 3945f10561
commit 5979eafb16
3 changed files with 6 additions and 12 deletions
@@ -444,7 +444,7 @@ public class NativeViewHierarchyManager {
arrayContains(tagsToDelete, viewToRemove.getId())) {
// The view will be removed and dropped by the 'delete' layout animation
// instead, so do nothing
} else if (viewToManage != null) {
} else {
viewManager.removeViewAt(viewToManage, normalizedIndexToRemove);
}
@@ -82,14 +82,10 @@ public class LayoutAnimationController {
}
public boolean shouldAnimateLayout(View viewToAnimate) {
// if view is null or the view parent is null, skip animation: view have been clipped,
// we don't want animation to resume when view is re-attached to parent, which is the
// standard android animation behavior. If there's a layout handling animation going on,
// it should be animated nonetheless since the ongoing animation needs to be updated.
if (viewToAnimate == null) {
return false;
}
// if view parent is null, skip animation: view have been clipped, we don't want animation to
// resume when view is re-attached to parent, which is the standard android animation behavior.
// If there's a layout handling animation going on, it should be animated nonetheless since the
// ongoing animation needs to be updated.
return (mShouldAnimateLayout && viewToAnimate.getParent() != null)
|| mLayoutHandlers.get(viewToAnimate.getId()) != null;
}
@@ -465,9 +465,7 @@ public class ReactViewGroup extends ViewGroup implements
mDrawingOrderHelper.handleRemoveView(getChildAt(index));
setChildrenDrawingOrderEnabled(mDrawingOrderHelper.shouldEnableCustomDrawingOrder());
if (getChildAt(index) != null) {
super.removeViewAt(index);
}
super.removeViewAt(index);
}
@Override