|
@@ -12,14 +12,18 @@ import com.reactnativenavigation.react.NavigationReactNativeHost;
|
12
|
12
|
|
13
|
13
|
public abstract class NavigationApplication extends Application implements ReactApplication {
|
14
|
14
|
|
15
|
|
- //TODO un mock this
|
16
|
|
- NavigationReactNativeHost reactNativeHost;
|
|
15
|
+ private NavigationReactNativeHost reactNativeHost;
|
17
|
16
|
ActivityLifecycleDelegate activityLifecycle;
|
18
|
17
|
|
19
|
18
|
@Override
|
20
|
19
|
public void onCreate() {
|
21
|
20
|
super.onCreate();
|
22
|
|
- init();
|
|
21
|
+ CommandsHandler commandsHandler = new CommandsHandler(this);
|
|
22
|
+ reactNativeHost = new NavigationReactNativeHost(this, isDebug(), commandsHandler);
|
|
23
|
+
|
|
24
|
+ ReactInstanceManager reactInstanceManager = reactNativeHost.getReactInstanceManager();
|
|
25
|
+ DevPermissionRequest devPermissionRequest = new DevPermissionRequest(this, isDebug());
|
|
26
|
+ activityLifecycle = new ActivityLifecycleDelegate(reactInstanceManager, devPermissionRequest);
|
23
|
27
|
}
|
24
|
28
|
|
25
|
29
|
@Override
|
|
@@ -28,14 +32,4 @@ public abstract class NavigationApplication extends Application implements React
|
28
|
32
|
}
|
29
|
33
|
|
30
|
34
|
public abstract boolean isDebug();
|
31
|
|
-
|
32
|
|
- //TODO inline this
|
33
|
|
- void init() {
|
34
|
|
- CommandsHandler commandsHandler = new CommandsHandler(this);
|
35
|
|
- reactNativeHost = new NavigationReactNativeHost(this, isDebug(), commandsHandler);
|
36
|
|
-
|
37
|
|
- ReactInstanceManager reactInstanceManager = reactNativeHost.getReactInstanceManager();
|
38
|
|
- DevPermissionRequest devPermissionRequest = new DevPermissionRequest(this, isDebug());
|
39
|
|
- activityLifecycle = new ActivityLifecycleDelegate(reactInstanceManager, devPermissionRequest);
|
40
|
|
- }
|
41
|
35
|
}
|