|
@@ -1,5 +1,7 @@
|
1
|
1
|
package com.reactnativenavigation.react;
|
2
|
2
|
|
|
3
|
+import android.app.Application;
|
|
4
|
+
|
3
|
5
|
import com.facebook.react.ReactNativeHost;
|
4
|
6
|
import com.facebook.react.ReactPackage;
|
5
|
7
|
import com.facebook.soloader.SoLoader;
|
|
@@ -10,13 +12,17 @@ import java.util.List;
|
10
|
12
|
|
11
|
13
|
public class ReactGateway {
|
12
|
14
|
|
13
|
|
- private final NavigationReactNativeHost reactNativeHost;
|
|
15
|
+ private final ReactNativeHost reactNativeHost;
|
14
|
16
|
private final NavigationReactInitializer initializer;
|
15
|
17
|
private final JsDevReloadHandler jsDevReloadHandler;
|
16
|
18
|
|
17
|
|
- public ReactGateway(final NavigationApplication application, final boolean isDebug, final List<ReactPackage> additionalReactPackages) {
|
|
19
|
+ public ReactGateway(final Application application, final boolean isDebug, final List<ReactPackage> additionalReactPackages) {
|
|
20
|
+ this(application, isDebug, new NavigationReactNativeHost(application, isDebug, additionalReactPackages));
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ public ReactGateway(final Application application, final boolean isDebug, final ReactNativeHost reactNativeHost) {
|
18
|
24
|
SoLoader.init(application, false);
|
19
|
|
- reactNativeHost = new NavigationReactNativeHost(application, isDebug, additionalReactPackages);
|
|
25
|
+ this.reactNativeHost = reactNativeHost;
|
20
|
26
|
initializer = new NavigationReactInitializer(reactNativeHost.getReactInstanceManager(), isDebug);
|
21
|
27
|
jsDevReloadHandler = new JsDevReloadHandler(reactNativeHost.getReactInstanceManager());
|
22
|
28
|
}
|