|
@@ -10,6 +10,7 @@ import com.facebook.react.ReactPackage;
|
10
|
10
|
import com.facebook.react.bridge.ReactContext;
|
11
|
11
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
12
|
12
|
import com.facebook.react.shell.MainReactPackage;
|
|
13
|
+import com.facebook.react.uimanager.UIImplementationProvider;
|
13
|
14
|
import com.reactnativenavigation.NavigationApplication;
|
14
|
15
|
import com.reactnativenavigation.bridge.NavigationReactEventEmitter;
|
15
|
16
|
import com.reactnativenavigation.bridge.NavigationReactPackage;
|
|
@@ -28,7 +29,28 @@ public class NavigationReactGateway implements ReactGateway {
|
28
|
29
|
private JsDevReloadHandler jsDevReloadHandler;
|
29
|
30
|
|
30
|
31
|
public NavigationReactGateway() {
|
31
|
|
- host = new ReactNativeHostImpl();
|
|
32
|
+ this(null);
|
|
33
|
+ }
|
|
34
|
+
|
|
35
|
+ public NavigationReactGateway(final UIImplementationProvider customImplProvider) {
|
|
36
|
+
|
|
37
|
+ if (customImplProvider != null) {
|
|
38
|
+ host = new ReactNativeHostImpl() {
|
|
39
|
+ /**
|
|
40
|
+ * This was added in case someone needs to provide a different UIImplementationProvider
|
|
41
|
+ * @param {UIImplementationProvider} defaultProvider
|
|
42
|
+ * @return {UIImplementationProvider}
|
|
43
|
+ */
|
|
44
|
+ @Override
|
|
45
|
+ protected UIImplementationProvider getUIImplementationProvider() {
|
|
46
|
+ return customImplProvider;
|
|
47
|
+ }
|
|
48
|
+ };
|
|
49
|
+ } else {
|
|
50
|
+ host = new ReactNativeHostImpl();
|
|
51
|
+ }
|
|
52
|
+
|
|
53
|
+
|
32
|
54
|
jsDevReloadHandler = new JsDevReloadHandler();
|
33
|
55
|
}
|
34
|
56
|
|
|
@@ -41,6 +63,7 @@ public class NavigationReactGateway implements ReactGateway {
|
41
|
63
|
return host.hasInstance() && getReactInstanceManager().getCurrentReactContext() != null;
|
42
|
64
|
}
|
43
|
65
|
|
|
66
|
+
|
44
|
67
|
@Override
|
45
|
68
|
public boolean hasStartedCreatingContext() {
|
46
|
69
|
return getReactInstanceManager().hasStartedCreatingInitialContext();
|
|
@@ -105,6 +128,7 @@ public class NavigationReactGateway implements ReactGateway {
|
105
|
128
|
}
|
106
|
129
|
}
|
107
|
130
|
|
|
131
|
+
|
108
|
132
|
public ReactNativeHost getReactNativeHost() {
|
109
|
133
|
return host;
|
110
|
134
|
}
|
|
@@ -114,12 +138,13 @@ public class NavigationReactGateway implements ReactGateway {
|
114
|
138
|
reactEventEmitter = new NavigationReactEventEmitter(context);
|
115
|
139
|
}
|
116
|
140
|
|
117
|
|
- private static class ReactNativeHostImpl extends ReactNativeHost implements ReactInstanceManager.ReactInstanceEventListener {
|
|
141
|
+ public static class ReactNativeHostImpl extends ReactNativeHost implements ReactInstanceManager.ReactInstanceEventListener {
|
118
|
142
|
|
119
|
|
- ReactNativeHostImpl() {
|
|
143
|
+ public ReactNativeHostImpl() {
|
120
|
144
|
super(NavigationApplication.instance);
|
121
|
145
|
}
|
122
|
146
|
|
|
147
|
+
|
123
|
148
|
@Override
|
124
|
149
|
public boolean getUseDeveloperSupport() {
|
125
|
150
|
return NavigationApplication.instance.isDebug();
|