mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
pass EventDispatcher to UIImplementation constructor
Summary: This way `UIImplementation` can hold on to it and use it outside of calls from the `UIManagerModule`. Reviewed By: lexs Differential Revision: D3899774 fbshipit-source-id: 01e4956c4540bcdf30774a3f40a625e934714ee9
This commit is contained in:
committed by
Facebook Github Bot
parent
5eb28dc4f0
commit
f7cbd56d8e
@@ -85,12 +85,13 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
public UIManagerModule(
|
||||
ReactApplicationContext reactContext,
|
||||
List<ViewManager> viewManagerList,
|
||||
UIImplementation uiImplementation) {
|
||||
UIImplementationProvider uiImplementationProvider) {
|
||||
super(reactContext);
|
||||
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext);
|
||||
mEventDispatcher = new EventDispatcher(reactContext);
|
||||
mModuleConstants = createConstants(viewManagerList);
|
||||
mUIImplementation = uiImplementation;
|
||||
mUIImplementation = uiImplementationProvider
|
||||
.createUIImplementation(reactContext, viewManagerList, mEventDispatcher);
|
||||
|
||||
reactContext.addLifecycleEventListener(this);
|
||||
}
|
||||
@@ -209,7 +210,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
public void updateNodeSize(int nodeViewTag, int newWidth, int newHeight) {
|
||||
getReactApplicationContext().assertOnNativeModulesQueueThread();
|
||||
|
||||
mUIImplementation.updateNodeSize(nodeViewTag, newWidth, newHeight, mEventDispatcher);
|
||||
mUIImplementation.updateNodeSize(nodeViewTag, newWidth, newHeight);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
@@ -496,7 +497,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
.arg("BatchId", batchId)
|
||||
.flush();
|
||||
try {
|
||||
mUIImplementation.dispatchViewUpdates(mEventDispatcher, batchId);
|
||||
mUIImplementation.dispatchViewUpdates(batchId);
|
||||
} finally {
|
||||
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user