Skip to content

Commit 05b75b9

Browse files
mdvaccafacebook-github-bot
authored andcommittedApr 23, 2018
Revert D7612904: [react-native][PR] Fix view indices with Android LayoutAnimation
Differential Revision: D7612904 Original commit changeset: a04cf47ab80e fbshipit-source-id: fd22a1243f770aab486f6c6d09726547c92841c0
1 parent fc42f9c commit 05b75b9

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed
 

‎ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,12 @@ public synchronized void manageChildren(
373373
if (mLayoutAnimationEnabled &&
374374
mLayoutAnimator.shouldAnimateLayout(viewToRemove) &&
375375
arrayContains(tagsToDelete, viewToRemove.getId())) {
376-
// Display the view in the parent after removal for the duration of the layout animation,
377-
// but pretend that it doesn't exist when calling other ViewGroup methods.
378-
viewManager.startViewTransition(viewToManage, viewToRemove);
376+
// The view will be removed and dropped by the 'delete' layout animation
377+
// instead, so do nothing
378+
} else {
379+
viewManager.removeViewAt(viewToManage, indexToRemove);
379380
}
380381

381-
viewManager.removeViewAt(viewToManage, indexToRemove);
382-
383382
lastIndexToRemove = indexToRemove;
384383
}
385384
}
@@ -424,9 +423,7 @@ public synchronized void manageChildren(
424423
mLayoutAnimator.deleteView(viewToDestroy, new LayoutAnimationListener() {
425424
@Override
426425
public void onAnimationEnd() {
427-
// Already removed from the ViewGroup, we can just end the transition here to
428-
// release the child.
429-
viewManager.endViewTransition(viewToManage, viewToDestroy);
426+
viewManager.removeView(viewToManage, viewToDestroy);
430427
dropView(viewToDestroy);
431428
}
432429
});

‎ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.java

-8
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ public void removeAllViews(T parent) {
9393
}
9494
}
9595

96-
public void startViewTransition(T parent, View view) {
97-
parent.startViewTransition(view);
98-
}
99-
100-
public void endViewTransition(T parent, View view) {
101-
parent.endViewTransition(view);
102-
}
103-
10496
/**
10597
* Returns whether this View type needs to handle laying out its own children instead of
10698
* deferring to the standard css-layout algorithm.

0 commit comments

Comments
 (0)
Please sign in to comment.