Adding configuration of Fabric inside ReactRootView.
Reviewed By: achen1 Differential Revision: D7102701 fbshipit-source-id: f655327372c42ad86042011a3af3ee693d14014a
This commit is contained in:
parent
6b45fb2cb1
commit
b5b0ee853e
|
@ -1007,7 +1007,8 @@ public class ReactInstanceManager {
|
|||
CatalystInstance catalystInstance) {
|
||||
Log.d(ReactConstants.TAG, "ReactInstanceManager.attachRootViewToInstance()");
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "attachRootViewToInstance");
|
||||
final int rootTag = catalystInstance.getNativeModule(UIManagerModule.class).addRootView(rootView);
|
||||
UIManager uiManagerModule = rootView.isFabric() ? catalystInstance.getFabricUIManager() : catalystInstance.getNativeModule(UIManagerModule.class);
|
||||
final int rootTag = uiManagerModule.addRootView(rootView);
|
||||
rootView.setRootViewTag(rootTag);
|
||||
rootView.invokeJSEntryPoint();
|
||||
Systrace.beginAsyncSection(
|
||||
|
|
|
@ -88,6 +88,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
|||
private int mWidthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
|
||||
private int mHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
|
||||
private @Nullable Runnable mJSEntryPoint;
|
||||
private boolean mIsFabric = false;
|
||||
|
||||
public ReactRootView(Context context) {
|
||||
super(context);
|
||||
|
@ -523,6 +524,14 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
|||
mReactInstanceManager.getCurrentReactContext().handleException(e);
|
||||
}
|
||||
|
||||
public void setIsFabric(boolean isFabric) {
|
||||
mIsFabric = isFabric;
|
||||
}
|
||||
|
||||
public boolean isFabric() {
|
||||
return mIsFabric;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ReactInstanceManager getReactInstanceManager() {
|
||||
return mReactInstanceManager;
|
||||
|
|
|
@ -361,7 +361,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
|
|||
float absoluteX,
|
||||
float absoluteY,
|
||||
UIViewOperationQueue uiViewOperationQueue,
|
||||
NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) {
|
||||
@Nullable NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) {
|
||||
if (mNodeUpdated) {
|
||||
onCollectExtraUpdates(uiViewOperationQueue);
|
||||
}
|
||||
|
@ -391,7 +391,18 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
|
|||
mScreenHeight = newScreenHeight;
|
||||
|
||||
if (layoutHasChanged) {
|
||||
nativeViewHierarchyOptimizer.handleUpdateLayout(this);
|
||||
//TODO: T26400974 ReactShadowNode should not depend on nativeViewHierarchyOptimizer
|
||||
if (nativeViewHierarchyOptimizer != null) {
|
||||
nativeViewHierarchyOptimizer.handleUpdateLayout(this);
|
||||
} else {
|
||||
uiViewOperationQueue.enqueueUpdateLayout(
|
||||
getParent().getReactTag(),
|
||||
getReactTag(),
|
||||
getScreenX(),
|
||||
getScreenY(),
|
||||
getScreenWidth(),
|
||||
getScreenHeight());
|
||||
}
|
||||
}
|
||||
|
||||
return layoutHasChanged;
|
||||
|
|
|
@ -764,7 +764,7 @@ public class UIViewOperationQueue {
|
|||
mOperations.add(0, new UIBlockOperation(block));
|
||||
}
|
||||
|
||||
/* package */ void dispatchViewUpdates(
|
||||
public void dispatchViewUpdates(
|
||||
final int batchId, final long commitStartTime, final long layoutTime) {
|
||||
SystraceMessage.beginSection(
|
||||
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
|
||||
|
|
Loading…
Reference in New Issue