|
@@ -7,18 +7,39 @@ import Navigation from './Navigation';
|
7
|
7
|
const resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource');
|
8
|
8
|
|
9
|
9
|
function startApp(params) {
|
10
|
|
- const screen = params.screen;
|
|
10
|
+ let screen = params.screen;
|
11
|
11
|
if (!screen.screenId) {
|
12
|
12
|
console.error('startApp(params): screenId property must be supplied');
|
13
|
13
|
return;
|
14
|
14
|
}
|
15
|
15
|
|
16
|
|
- const actualScreen = Navigation.getRegisteredScreen(screen.screenId);
|
17
|
16
|
screen.screenInstanceId = _.uniqueId('screenInstanceId');
|
|
17
|
+ params.screen = convertNavigationStyleToScreenStyle(screen);
|
18
|
18
|
|
19
|
19
|
NativeModules.NavigationReactModule.startApp(params);
|
20
|
20
|
}
|
21
|
21
|
|
|
22
|
+function convertNavigationStyleToScreenStyle(screen) {
|
|
23
|
+ const navigatorStyle = screen.navigatorStyle;
|
|
24
|
+ if (!navigatorStyle) {
|
|
25
|
+ return screen;
|
|
26
|
+ }
|
|
27
|
+
|
|
28
|
+ screen.styleParams = {
|
|
29
|
+ statusBarColor: navigatorStyle.statusBarColor,
|
|
30
|
+ topBarColor: navigatorStyle.toolBarColor,
|
|
31
|
+ navigationBarColor: navigatorStyle.navigationBarColor,
|
|
32
|
+ titleBarHidden: navigatorStyle.navBarHidden,
|
|
33
|
+ backButtonHidden: navigatorStyle.backButtonHidden,
|
|
34
|
+ topTabsHidden: navigatorStyle.topTabsHidden,
|
|
35
|
+ bottomTabsHidden: navigatorStyle.tabBarHidden,
|
|
36
|
+ bottomTabsHiddenOnScroll: navigatorStyle.bottomTabsHiddenOnScroll
|
|
37
|
+ };
|
|
38
|
+
|
|
39
|
+ screen = _.omit(screen, ['navigatorStyle']);
|
|
40
|
+ return screen;
|
|
41
|
+}
|
|
42
|
+
|
22
|
43
|
module.exports = {
|
23
|
44
|
startApp
|
24
|
45
|
};
|