Daniel Zlotin 7 years ago
parent
commit
9b704e36e2

+ 7
- 13
lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java View File

12
 
12
 
13
 public abstract class NavigationApplication extends Application implements ReactApplication {
13
 public abstract class NavigationApplication extends Application implements ReactApplication {
14
 
14
 
15
-	//TODO un mock this
16
-	NavigationReactNativeHost reactNativeHost;
15
+	private NavigationReactNativeHost reactNativeHost;
17
 	ActivityLifecycleDelegate activityLifecycle;
16
 	ActivityLifecycleDelegate activityLifecycle;
18
 
17
 
19
 	@Override
18
 	@Override
20
 	public void onCreate() {
19
 	public void onCreate() {
21
 		super.onCreate();
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
 	@Override
29
 	@Override
28
 	}
32
 	}
29
 
33
 
30
 	public abstract boolean isDebug();
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
 }