BREAKING - Remove LayoutAnimation experimental flag on Android

Summary:
I don't remember exactly where we talked about this but LayoutAnimation on Android is pretty stable now so there's no reason to keep it behind an experimental flag anymore. The only part that is not really stable is delete animations, so what I did is remove the default delete animation that we provide in presets.

**Test plan**
Tested that layout animations work properly without any config.
Closes https://github.com/facebook/react-native/pull/12141

Differential Revision: D4494386

Pulled By: mkonicek

fbshipit-source-id: 5dd025584e35f9bff25dc299cc9ca5c5bf5f17a3
This commit is contained in:
Janic Duplessis
2017-03-08 06:39:39 -08:00
committed by Facebook Github Bot
parent 36eb69ecd0
commit abc483a653
8 changed files with 3 additions and 86 deletions

View File

@@ -76,8 +76,6 @@ public class NativeViewHierarchyManager {
private final RootViewManager mRootViewManager;
private final LayoutAnimationController mLayoutAnimator = new LayoutAnimationController();
private boolean mLayoutAnimationEnabled;
public NativeViewHierarchyManager(ViewManagerRegistry viewManagers) {
this(viewManagers, new RootViewManager());
}
@@ -112,10 +110,6 @@ public class NativeViewHierarchyManager {
return mAnimationRegistry;
}
public void setLayoutAnimationEnabled(boolean enabled) {
mLayoutAnimationEnabled = enabled;
}
public void updateProperties(int tag, ReactStylesDiffMap props) {
UiThreadUtil.assertOnUiThread();
@@ -192,8 +186,7 @@ public class NativeViewHierarchyManager {
}
private void updateLayout(View viewToUpdate, int x, int y, int width, int height) {
if (mLayoutAnimationEnabled &&
mLayoutAnimator.shouldAnimateLayout(viewToUpdate)) {
if (mLayoutAnimator.shouldAnimateLayout(viewToUpdate)) {
mLayoutAnimator.applyLayoutUpdate(viewToUpdate, x, y, width, height);
} else {
viewToUpdate.layout(x, y, x + width, y + height);
@@ -363,8 +356,7 @@ public class NativeViewHierarchyManager {
View viewToRemove = viewManager.getChildAt(viewToManage, indexToRemove);
if (mLayoutAnimationEnabled &&
mLayoutAnimator.shouldAnimateLayout(viewToRemove) &&
if (mLayoutAnimator.shouldAnimateLayout(viewToRemove) &&
arrayContains(tagsToDelete, viewToRemove.getId())) {
// The view will be removed and dropped by the 'delete' layout animation
// instead, so do nothing
@@ -411,8 +403,7 @@ public class NativeViewHierarchyManager {
tagsToDelete));
}
if (mLayoutAnimationEnabled &&
mLayoutAnimator.shouldAnimateLayout(viewToDestroy)) {
if (mLayoutAnimator.shouldAnimateLayout(viewToDestroy)) {
mLayoutAnimator.deleteView(viewToDestroy, new LayoutAnimationListener() {
@Override
public void onAnimationEnd() {