int addRootView(
final T rootView) {
return addRootView(rootView, null, null);
}
@@ -391,7 +391,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule
* TODO(6242243): Make addRootView thread safe NB: this method is horribly not-thread-safe.
*/
@Override
- public int addRootView(
+ public int addRootView(
final T rootView, WritableMap initialProps, @Nullable String initialUITemplate) {
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIManagerModule.addRootView");
final int tag = ReactRootViewTagGenerator.getNextRootViewTag();
@@ -400,21 +400,6 @@ public class UIManagerModule extends ReactContextBaseJavaModule
new ThemedReactContext(reactApplicationContext, rootView.getContext());
mUIImplementation.registerRootView(rootView, tag, themedRootContext);
-
- rootView.setOnSizeChangedListener(
- new SizeMonitoringFrameLayout.OnSizeChangedListener() {
- @Override
- public void onSizeChanged(final int width, final int height, int oldW, int oldH) {
- reactApplicationContext.runOnNativeModulesQueueThread(
- new GuardedRunnable(reactApplicationContext) {
- @Override
- public void runGuarded() {
- updateNodeSize(tag, width, height);
- }
- });
- }
- });
-
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
return tag;
}
diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java
index 68fec4b0737..9b86f083e2c 100644
--- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java
+++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java
@@ -8,6 +8,7 @@
package com.facebook.react.uimanager;
import android.os.SystemClock;
+import android.view.View;
import com.facebook.common.logging.FLog;
import com.facebook.react.animation.Animation;
import com.facebook.react.animation.AnimationRegistry;
@@ -21,7 +22,6 @@ import com.facebook.react.bridge.SoftAssertions;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.modules.core.ReactChoreographer;
-import com.facebook.react.uimanager.common.SizeMonitoringFrameLayout;
import com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;
import com.facebook.systrace.Systrace;
import com.facebook.systrace.SystraceMessage;
@@ -673,11 +673,8 @@ public class UIViewOperationQueue {
return mOperations.isEmpty();
}
- public void addRootView(
- final int tag,
- final SizeMonitoringFrameLayout rootView,
- final ThemedReactContext themedRootContext) {
- mNativeViewHierarchyManager.addRootView(tag, rootView, themedRootContext);
+ public void addRootView(final int tag, final View rootView) {
+ mNativeViewHierarchyManager.addRootView(tag, rootView);
}
/**
diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/SizeMonitoringFrameLayout.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/SizeMonitoringFrameLayout.java
deleted file mode 100644
index 819753ca4db..00000000000
--- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/SizeMonitoringFrameLayout.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-package com.facebook.react.uimanager.common;
-
-import javax.annotation.Nullable;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.widget.FrameLayout;
-
-/**
- * Subclass of {@link FrameLayout} that allows registering for size change events. The main purpose
- * for this class is to hide complexity of {@link ReactRootView} from the code under
- * {@link com.facebook.react.uimanager} package.
- */
-public class SizeMonitoringFrameLayout extends FrameLayout {
-
- public interface OnSizeChangedListener {
- void onSizeChanged(int width, int height, int oldWidth, int oldHeight);
- }
-
- private @Nullable OnSizeChangedListener mOnSizeChangedListener;
-
- public SizeMonitoringFrameLayout(Context context) {
- super(context);
- }
-
- public SizeMonitoringFrameLayout(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public SizeMonitoringFrameLayout(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- public void setOnSizeChangedListener(OnSizeChangedListener onSizeChangedListener) {
- mOnSizeChangedListener = onSizeChangedListener;
- }
-
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
-
- if (mOnSizeChangedListener != null) {
- mOnSizeChangedListener.onSizeChanged(w, h, oldw, oldh);
- }
- }
-}