mirror of
https://github.com/status-im/react-native.git
synced 2025-02-26 16:10:58 +00:00
Expose rootViewTag for ReactRootView
Reviewed By: AaaChiuuu Differential Revision: D3630452 fbshipit-source-id: 9e7e750051b8bd5c60971a82740916e2e5faf6f6
This commit is contained in:
parent
23ede0fbc7
commit
7d27f4941c
@ -773,6 +773,7 @@ import static com.facebook.react.bridge.ReactMarkerConstants.RUN_JS_BUNDLE_START
|
||||
|
||||
UIManagerModule uiManagerModule = catalystInstance.getNativeModule(UIManagerModule.class);
|
||||
int rootTag = uiManagerModule.addMeasuredRootView(rootView);
|
||||
rootView.setRootViewTag(rootTag);
|
||||
@Nullable Bundle launchOptions = rootView.getLaunchOptions();
|
||||
WritableMap initialProps = launchOptions != null
|
||||
? Arguments.fromBundle(launchOptions)
|
||||
|
@ -58,6 +58,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
|
||||
private @Nullable Bundle mLaunchOptions;
|
||||
private @Nullable KeyboardListener mKeyboardListener;
|
||||
private @Nullable OnGenericMotionListener mOnGenericMotionListener;
|
||||
private int mRootViewTag;
|
||||
private boolean mWasMeasured = false;
|
||||
private boolean mIsAttachedToInstance = false;
|
||||
private final JSTouchDispatcher mJSTouchDispatcher = new JSTouchDispatcher(this);
|
||||
@ -281,6 +282,14 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
|
||||
"of your hosting Activity or in the onDestroyView() of your hosting Fragment.");
|
||||
}
|
||||
|
||||
public int getRootViewTag() {
|
||||
return mRootViewTag;
|
||||
}
|
||||
|
||||
public void setRootViewTag(int rootViewTag) {
|
||||
mRootViewTag = rootViewTag;
|
||||
}
|
||||
|
||||
private class KeyboardListener implements ViewTreeObserver.OnGlobalLayoutListener {
|
||||
private final Rect mVisibleViewArea;
|
||||
private final int mMinKeyboardHeightDetected;
|
||||
|
@ -765,6 +765,7 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
|
||||
|
||||
UIManagerModule uiManagerModule = catalystInstance.getNativeModule(UIManagerModule.class);
|
||||
int rootTag = uiManagerModule.addMeasuredRootView(rootView);
|
||||
rootView.setRootViewTag(rootTag);
|
||||
@Nullable Bundle launchOptions = rootView.getLaunchOptions();
|
||||
WritableMap initialProps = Arguments.makeNativeMap(launchOptions);
|
||||
String jsAppModuleName = rootView.getJSModuleName();
|
||||
|
Loading…
x
Reference in New Issue
Block a user