mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Register C++ ViewManagers in React Native Renderer
Summary: This diff integrates the registration of C++ component into React Native Android changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D38725769 fbshipit-source-id: 33eb9ebb93983c4038529748758eac3e43eec3e5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a2d2a1df90
commit
0519dfeeaf
@@ -42,7 +42,8 @@ public class Binding {
|
||||
Object uiManager,
|
||||
EventBeatManager eventBeatManager,
|
||||
ComponentFactory componentsRegistry,
|
||||
Object reactNativeConfig);
|
||||
Object reactNativeConfig,
|
||||
CppComponentRegistry cppComponentRegistry);
|
||||
|
||||
public native void startSurface(
|
||||
int surfaceId, @NonNull String moduleName, @NonNull NativeMap initialProps);
|
||||
@@ -89,6 +90,24 @@ public class Binding {
|
||||
@NonNull EventBeatManager eventBeatManager,
|
||||
@NonNull ComponentFactory componentFactory,
|
||||
@NonNull ReactNativeConfig reactNativeConfig) {
|
||||
register(
|
||||
runtimeExecutor,
|
||||
runtimeScheduler,
|
||||
fabricUIManager,
|
||||
eventBeatManager,
|
||||
componentFactory,
|
||||
reactNativeConfig,
|
||||
null);
|
||||
}
|
||||
|
||||
public void register(
|
||||
@NonNull RuntimeExecutor runtimeExecutor,
|
||||
@Nullable RuntimeScheduler runtimeScheduler,
|
||||
@NonNull FabricUIManager fabricUIManager,
|
||||
@NonNull EventBeatManager eventBeatManager,
|
||||
@NonNull ComponentFactory componentFactory,
|
||||
@NonNull ReactNativeConfig reactNativeConfig,
|
||||
@Nullable CppComponentRegistry cppComponentRegistry) {
|
||||
fabricUIManager.setBinding(this);
|
||||
installFabricUIManager(
|
||||
runtimeExecutor,
|
||||
@@ -96,7 +115,8 @@ public class Binding {
|
||||
fabricUIManager,
|
||||
eventBeatManager,
|
||||
componentFactory,
|
||||
reactNativeConfig);
|
||||
reactNativeConfig,
|
||||
cppComponentRegistry);
|
||||
|
||||
setPixelDensity(PixelUtil.getDisplayMetricDensity());
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package com.facebook.react.fabric;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.react.bridge.JSIModuleProvider;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.UIManager;
|
||||
@@ -23,16 +24,27 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
|
||||
@NonNull private final ComponentFactory mComponentFactory;
|
||||
@NonNull private final ReactNativeConfig mConfig;
|
||||
@NonNull private final ViewManagerRegistry mViewManagerRegistry;
|
||||
@Nullable private final CppComponentRegistry mCppComponentRegistry;
|
||||
|
||||
public FabricJSIModuleProvider(
|
||||
@NonNull ReactApplicationContext reactApplicationContext,
|
||||
@NonNull ComponentFactory componentFactory,
|
||||
@NonNull ReactNativeConfig config,
|
||||
@NonNull ViewManagerRegistry viewManagerRegistry) {
|
||||
this(reactApplicationContext, componentFactory, config, viewManagerRegistry, null);
|
||||
}
|
||||
|
||||
public FabricJSIModuleProvider(
|
||||
@NonNull ReactApplicationContext reactApplicationContext,
|
||||
@NonNull ComponentFactory componentFactory,
|
||||
@NonNull ReactNativeConfig config,
|
||||
@NonNull ViewManagerRegistry viewManagerRegistry,
|
||||
@Nullable CppComponentRegistry cppComponentRegistry) {
|
||||
mReactApplicationContext = reactApplicationContext;
|
||||
mComponentFactory = componentFactory;
|
||||
mConfig = config;
|
||||
mViewManagerRegistry = viewManagerRegistry;
|
||||
mCppComponentRegistry = cppComponentRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,7 +67,8 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
|
||||
uiManager,
|
||||
eventBeatManager,
|
||||
mComponentFactory,
|
||||
mConfig);
|
||||
mConfig,
|
||||
mCppComponentRegistry);
|
||||
|
||||
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
|
||||
Reference in New Issue
Block a user