|
@@ -22,24 +22,60 @@ function startSingleScreenApp(params) {
|
22
|
22
|
//const drawer = setupDrawer(params.drawer);
|
23
|
23
|
|
24
|
24
|
screen.screenId = screen.screen;
|
|
25
|
+
|
|
26
|
+ /*
|
|
27
|
+ * adapt to new API
|
|
28
|
+ */
|
|
29
|
+ params.screen = adaptNavigationStyleToScreenStyle(screen);
|
|
30
|
+ params.screen = adaptNavigationParams(screen);
|
|
31
|
+
|
25
|
32
|
newPlatformSpecific.startApp(params);
|
26
|
33
|
}
|
27
|
34
|
|
28
|
|
-function startTabBasedApp(params) {
|
29
|
|
- if (!params.tabs) {
|
30
|
|
- console.error('startTabBasedApp(params): params.tabs is required');
|
31
|
|
- return;
|
|
35
|
+function adaptNavigationStyleToScreenStyle(screen) {
|
|
36
|
+ const navigatorStyle = screen.navigatorStyle;
|
|
37
|
+ if (!navigatorStyle) {
|
|
38
|
+ return screen;
|
32
|
39
|
}
|
33
|
40
|
|
34
|
|
- params.tabs.forEach(function(tab, idx) {
|
35
|
|
- addNavigatorParams(tab, null, idx);
|
36
|
|
- addNavigatorButtons(tab);
|
37
|
|
- addNavigationStyleParams(tab);
|
38
|
|
- addTabIcon(tab);
|
39
|
|
- tab.passProps = params.passProps;
|
40
|
|
- });
|
|
41
|
+ screen.styleParams = {
|
|
42
|
+ statusBarColor: navigatorStyle.statusBarColor,
|
|
43
|
+ topBarColor: navigatorStyle.toolBarColor,
|
|
44
|
+ navigationBarColor: navigatorStyle.navigationBarColor,
|
|
45
|
+ titleBarHidden: navigatorStyle.navBarHidden,
|
|
46
|
+ backButtonHidden: navigatorStyle.backButtonHidden,
|
|
47
|
+ topTabsHidden: navigatorStyle.topTabsHidden,
|
|
48
|
+ bottomTabsHidden: navigatorStyle.tabBarHidden,
|
|
49
|
+ bottomTabsHiddenOnScroll: navigatorStyle.bottomTabsHiddenOnScroll
|
|
50
|
+ };
|
|
51
|
+
|
|
52
|
+ return _.omit(screen, ['navigatorStyle']);
|
|
53
|
+}
|
|
54
|
+
|
|
55
|
+function adaptNavigationParams(screen) {
|
|
56
|
+ screen.navigationParams = {
|
|
57
|
+ screenInstanceID: screen.screenInstanceID,
|
|
58
|
+ navigatorID: screen.navigatorID,
|
|
59
|
+ navigatorEventID: screen.navigatorEventID
|
|
60
|
+ };
|
|
61
|
+ return _.omit(screen, ['screenInstanceID', 'navigatorID', 'navigatorEventID']);
|
|
62
|
+}
|
41
|
63
|
|
42
|
|
- const drawer = setupDrawer(params.drawer);
|
|
64
|
+function startTabBasedApp(params) {
|
|
65
|
+ //if (!params.tabs) {
|
|
66
|
+ // console.error('startTabBasedApp(params): params.tabs is required');
|
|
67
|
+ // return;
|
|
68
|
+ //}
|
|
69
|
+ //
|
|
70
|
+ //params.tabs.forEach(function(tab, idx) {
|
|
71
|
+ // addNavigatorParams(tab, null, idx);
|
|
72
|
+ // addNavigatorButtons(tab);
|
|
73
|
+ // addNavigationStyleParams(tab);
|
|
74
|
+ // addTabIcon(tab);
|
|
75
|
+ // tab.passProps = params.passProps;
|
|
76
|
+ //});
|
|
77
|
+ //
|
|
78
|
+ //const drawer = setupDrawer(params.drawer);
|
43
|
79
|
//RctActivity.startTabBasedApp(params.tabs, params.tabsStyle, drawer);
|
44
|
80
|
}
|
45
|
81
|
|
|
@@ -57,28 +93,28 @@ function addTabIcon(tab) {
|
57
|
93
|
}
|
58
|
94
|
|
59
|
95
|
function navigatorPush(navigator, params) {
|
60
|
|
- addNavigatorParams(params, navigator);
|
61
|
|
- addNavigatorButtons(params);
|
62
|
|
- addNavigationStyleParams(params);
|
|
96
|
+ //addNavigatorParams(params, navigator);
|
|
97
|
+ //addNavigatorButtons(params);
|
|
98
|
+ //addNavigationStyleParams(params);
|
63
|
99
|
//RctActivity.navigatorPush(params);
|
64
|
100
|
}
|
65
|
101
|
|
66
|
102
|
function navigatorSetButtons(navigator, navigatorEventID, params) {
|
67
|
|
- if (params.rightButtons) {
|
68
|
|
- params.rightButtons.forEach(function(button) {
|
69
|
|
- if (button.icon) {
|
70
|
|
- const icon = resolveAssetSource(button.icon);
|
71
|
|
- if (icon) {
|
72
|
|
- button.icon = icon.uri;
|
73
|
|
- }
|
74
|
|
- }
|
75
|
|
- });
|
76
|
|
- }
|
|
103
|
+ //if (params.rightButtons) {
|
|
104
|
+ // params.rightButtons.forEach(function(button) {
|
|
105
|
+ // if (button.icon) {
|
|
106
|
+ // const icon = resolveAssetSource(button.icon);
|
|
107
|
+ // if (icon) {
|
|
108
|
+ // button.icon = icon.uri;
|
|
109
|
+ // }
|
|
110
|
+ // }
|
|
111
|
+ // });
|
|
112
|
+ //}
|
77
|
113
|
//RctActivity.setNavigatorButtons(params);
|
78
|
114
|
}
|
79
|
115
|
|
80
|
116
|
function navigatorPop(navigator, params) {
|
81
|
|
- addNavigatorParams(params, navigator);
|
|
117
|
+ //addNavigatorParams(params, navigator);
|
82
|
118
|
//RctActivity.navigatorPop(params);
|
83
|
119
|
}
|
84
|
120
|
|
|
@@ -90,9 +126,9 @@ function navigatorPopToRoot(navigator, params) {
|
90
|
126
|
}
|
91
|
127
|
|
92
|
128
|
function navigatorResetTo(navigator, params) {
|
93
|
|
- addNavigatorParams(params, navigator);
|
94
|
|
- addNavigatorButtons(params);
|
95
|
|
- addNavigationStyleParams(params);
|
|
129
|
+ //addNavigatorParams(params, navigator);
|
|
130
|
+ //addNavigatorButtons(params);
|
|
131
|
+ //addNavigationStyleParams(params);
|
96
|
132
|
//RctActivity.navigatorResetTo(params);
|
97
|
133
|
}
|
98
|
134
|
|
|
@@ -137,9 +173,9 @@ function navigatorToggleTabs(navigator, params) {
|
137
|
173
|
}
|
138
|
174
|
|
139
|
175
|
function showModal(params) {
|
140
|
|
- addNavigatorParams(params);
|
141
|
|
- addNavigatorButtons(params);
|
142
|
|
- addNavigationStyleParams(params);
|
|
176
|
+ //addNavigatorParams(params);
|
|
177
|
+ //addNavigatorButtons(params);
|
|
178
|
+ //addNavigationStyleParams(params);
|
143
|
179
|
//RctActivity.showModal(params);
|
144
|
180
|
}
|
145
|
181
|
|
|
@@ -162,8 +198,7 @@ function addNavigatorButtons(screen) {
|
162
|
198
|
Object.assign(screen, Screen.navigatorButtons);
|
163
|
199
|
|
164
|
200
|
// Get image uri from image id
|
165
|
|
- const rightButtons = screen.rightButtons ? screen.rightButtons : screen.navigatorButtons ?
|
166
|
|
- screen.navigatorButtons.rightButtons : null;
|
|
201
|
+ const rightButtons = screen.navigatorButtons ? screen.navigatorButtons.rightButtons : null;
|
167
|
202
|
|
168
|
203
|
if (rightButtons) {
|
169
|
204
|
rightButtons.forEach(function(button) {
|
|
@@ -198,13 +233,12 @@ function setupDrawer(drawerParams) {
|
198
|
233
|
if (drawer.disableOpenGesture === undefined) {
|
199
|
234
|
drawer.disableOpenGesture = false;
|
200
|
235
|
}
|
201
|
|
- ;
|
202
|
236
|
|
203
|
237
|
return drawer;
|
204
|
238
|
}
|
205
|
239
|
|
206
|
240
|
function showFAB(params) {
|
207
|
|
- params.icon = resolveAssetSource(params.icon).uri;
|
|
241
|
+ //params.icon = resolveAssetSource(params.icon).uri;
|
208
|
242
|
//RctActivity.showFAB(params);
|
209
|
243
|
}
|
210
|
244
|
|
|
@@ -226,4 +260,4 @@ export default {
|
226
|
260
|
navigatorToggleDrawer,
|
227
|
261
|
navigatorToggleTabs,
|
228
|
262
|
navigatorToggleNavBar
|
229
|
|
-}
|
|
263
|
+};
|