Skip to content

Commit 0b09e6f

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Remove unnecessary classes inside com.facebook.react.uimanager.layoutanimation (#54730)
Summary: Pull Request resolved: #54730 I'm deleting those 2 classes related to layout animation. They were needed only for legacy arch. They're not needed anymore so they can go now. Marked as breaking because those 2 classes were public, but I wasn't able to find meaningful usages in OSS Changelog: [Android] [Breaking] - Remove unnecessary classes inside `com.facebook.react.uimanager.layoutanimation` used in legacy architecture Reviewed By: javache Differential Revision: D88011209 fbshipit-source-id: a45ec8342a2cdd150264ff9de9da7060b93bf55c
1 parent c3a7ce3 commit 0b09e6f

File tree

4 files changed

+5
-159
lines changed

4 files changed

+5
-159
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4890,19 +4890,6 @@ public final class com/facebook/react/uimanager/events/TouchEventType$Companion
48904890
public final fun getJSEventName (Lcom/facebook/react/uimanager/events/TouchEventType;)Ljava/lang/String;
48914891
}
48924892

4893-
public class com/facebook/react/uimanager/layoutanimation/LayoutAnimationController {
4894-
public fun <init> ()V
4895-
public fun applyLayoutUpdate (Landroid/view/View;IIII)V
4896-
public fun deleteView (Landroid/view/View;Lcom/facebook/react/uimanager/layoutanimation/LayoutAnimationListener;)V
4897-
public final fun initializeFromConfig (Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Callback;)V
4898-
public fun reset ()V
4899-
public fun shouldAnimateLayout (Landroid/view/View;)Z
4900-
}
4901-
4902-
public abstract interface class com/facebook/react/uimanager/layoutanimation/LayoutAnimationListener {
4903-
public abstract fun onAnimationEnd ()V
4904-
}
4905-
49064893
public final class com/facebook/react/uimanager/style/BackgroundImageLayer {
49074894
public static final field Companion Lcom/facebook/react/uimanager/style/BackgroundImageLayer$Companion;
49084895
public fun <init> ()V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
3232
import com.facebook.react.common.build.ReactBuildConfig;
3333
import com.facebook.react.touch.JSResponderHandler;
34-
import com.facebook.react.uimanager.layoutanimation.LayoutAnimationController;
35-
import com.facebook.react.uimanager.layoutanimation.LayoutAnimationListener;
3634
import com.facebook.systrace.Systrace;
3735
import com.facebook.systrace.SystraceMessage;
3836
import com.facebook.yoga.YogaDirection;
@@ -86,7 +84,6 @@ public class NativeViewHierarchyManager {
8684
private final ViewManagerRegistry mViewManagers;
8785
private final JSResponderHandler mJSResponderHandler = new JSResponderHandler();
8886
private final RootViewManager mRootViewManager;
89-
private final LayoutAnimationController mLayoutAnimator = new LayoutAnimationController();
9087
private final RectF mBoundingBox = new RectF();
9188

9289
private volatile boolean mLayoutAnimationEnabled;
@@ -265,9 +262,7 @@ public synchronized long getInstanceHandle(int reactTag) {
265262
}
266263

267264
private void updateLayout(View viewToUpdate, int x, int y, int width, int height) {
268-
if (mLayoutAnimationEnabled && mLayoutAnimator.shouldAnimateLayout(viewToUpdate)) {
269-
mLayoutAnimator.applyLayoutUpdate(viewToUpdate, x, y, width, height);
270-
} else {
265+
if (!mLayoutAnimationEnabled) {
271266
viewToUpdate.layout(x, y, x + width, y + height);
272267
}
273268
}
@@ -464,14 +459,7 @@ public synchronized void manageChildren(
464459
viewToManage, viewManager, indicesToRemove, viewsToAdd, tagsToDelete));
465460
}
466461

467-
View viewToRemove = viewManager.getChildAt(viewToManage, indexToRemove);
468-
469-
if (mLayoutAnimationEnabled
470-
&& mLayoutAnimator.shouldAnimateLayout(viewToRemove)
471-
&& arrayContains(tagsToDelete, viewToRemove.getId())) {
472-
// The view will be removed and dropped by the 'delete' layout animation
473-
// instead, so do nothing
474-
} else {
462+
if (!mLayoutAnimationEnabled) {
475463
viewManager.removeViewAt(viewToManage, indexToRemove);
476464
}
477465

@@ -492,26 +480,7 @@ && arrayContains(tagsToDelete, viewToRemove.getId())) {
492480
viewToManage, viewManager, indicesToRemove, viewsToAdd, tagsToDelete));
493481
}
494482

495-
if (mLayoutAnimationEnabled && mLayoutAnimator.shouldAnimateLayout(viewToDestroy)) {
496-
pendingDeletionTags.add(tagToDelete);
497-
mLayoutAnimator.deleteView(
498-
viewToDestroy,
499-
new LayoutAnimationListener() {
500-
@Override
501-
public void onAnimationEnd() {
502-
// This should be called only on the UI thread, because
503-
// onAnimationEnd is called (indirectly) by Android View Animation.
504-
UiThreadUtil.assertOnUiThread();
505-
506-
viewManager.removeView(viewToManage, viewToDestroy);
507-
dropView(viewToDestroy);
508-
pendingDeletionTags.remove(viewToDestroy.getId());
509-
if (pendingDeletionTags.isEmpty()) {
510-
mPendingDeletionsForTag.remove(tag);
511-
}
512-
}
513-
});
514-
} else {
483+
if (!mLayoutAnimationEnabled) {
515484
dropView(viewToDestroy);
516485
}
517486
}
@@ -828,11 +797,11 @@ public synchronized void clearJSResponder() {
828797

829798
synchronized void configureLayoutAnimation(
830799
final ReadableMap config, final Callback onAnimationComplete) {
831-
mLayoutAnimator.initializeFromConfig(config, onAnimationComplete);
800+
// no-op
832801
}
833802

834803
synchronized void clearLayoutAnimation() {
835-
mLayoutAnimator.reset();
804+
// no-op
836805
}
837806

838807
@Deprecated

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.kt

Lines changed: 0 additions & 87 deletions
This file was deleted.

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationListener.kt

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)