mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 17:13:46 +08:00
ShadowNodeHierarchyManager should be supplied externally to UIManagerModule
Summary: public UIManagerModule should not be creating UIImplementation. Instead, UIImplementation instance should be supplied to it to allow plugging in different implementations. No functional changes. Reviewed By: astreet Differential Revision: D2464632 fb-gh-sync-id: e7372977c93ceb7ef5e8658e5ee7e8e87f52d851
This commit is contained in:
committed by
facebook-github-bot-5
parent
599a130c9a
commit
fd0d987768
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -78,17 +78,27 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
private int mNextRootViewTag = 1;
|
||||
private int mBatchId = 0;
|
||||
|
||||
public UIManagerModule(ReactApplicationContext reactContext, List<ViewManager> viewManagerList) {
|
||||
/**
|
||||
* This contructor is temporarily here to workaround Sandcastle error.
|
||||
*/
|
||||
public UIManagerModule(
|
||||
ReactApplicationContext reactContext,
|
||||
List<ViewManager> viewManagerList) {
|
||||
this(reactContext, viewManagerList, new UIImplementation(reactContext, viewManagerList));
|
||||
}
|
||||
|
||||
public UIManagerModule(
|
||||
ReactApplicationContext reactContext,
|
||||
List<ViewManager> viewManagerList,
|
||||
UIImplementation uiImplementation) {
|
||||
super(reactContext);
|
||||
mEventDispatcher = new EventDispatcher(reactContext);
|
||||
DisplayMetrics displayMetrics = reactContext.getResources().getDisplayMetrics();
|
||||
DisplayMetricsHolder.setDisplayMetrics(displayMetrics);
|
||||
mModuleConstants = createConstants(displayMetrics, viewManagerList);
|
||||
reactContext.addLifecycleEventListener(this);
|
||||
mUIImplementation = uiImplementation;
|
||||
|
||||
mUIImplementation = new UIImplementation(
|
||||
reactContext,
|
||||
new ViewManagerRegistry(viewManagerList));
|
||||
reactContext.addLifecycleEventListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user