|
@@ -35,7 +35,10 @@ function startTabBasedApp(params) {
|
35
|
35
|
},
|
36
|
36
|
renderBody: function() {
|
37
|
37
|
return (
|
38
|
|
- <TabBarControllerIOS id={controllerID + '_tabs'}>
|
|
38
|
+ <TabBarControllerIOS
|
|
39
|
+ id={controllerID + '_tabs'}
|
|
40
|
+ style={params.tabsStyle}
|
|
41
|
+ >
|
39
|
42
|
{
|
40
|
43
|
params.tabs.map(function(tab, index) {
|
41
|
44
|
const navigatorID = controllerID + '_nav' + index;
|
|
@@ -251,6 +254,44 @@ function navigatorToggleDrawer(navigator, params) {
|
251
|
254
|
}
|
252
|
255
|
}
|
253
|
256
|
|
|
257
|
+function navigatorToggleTabs(navigator, params) {
|
|
258
|
+ const controllerID = navigator.navigatorID.split('_')[0];
|
|
259
|
+ Controllers.TabBarControllerIOS(controllerID + '_tabs').setHidden({
|
|
260
|
+ hidden: params.to == 'hidden',
|
|
261
|
+ animated: !(params.animated === false)
|
|
262
|
+ });
|
|
263
|
+}
|
|
264
|
+
|
|
265
|
+function navigatorSetTabBadge(navigator, params) {
|
|
266
|
+ const controllerID = navigator.navigatorID.split('_')[0];
|
|
267
|
+ if (params.tabIndex || params.tabIndex === 0) {
|
|
268
|
+ Controllers.TabBarControllerIOS(controllerID + '_tabs').setBadge({
|
|
269
|
+ tabIndex: params.tabIndex,
|
|
270
|
+ badge: params.badge
|
|
271
|
+ });
|
|
272
|
+ } else {
|
|
273
|
+ Controllers.TabBarControllerIOS(controllerID + '_tabs').setBadge({
|
|
274
|
+ contentId: navigator.navigatorID,
|
|
275
|
+ contentType: 'NavigationControllerIOS',
|
|
276
|
+ badge: params.badge
|
|
277
|
+ });
|
|
278
|
+ }
|
|
279
|
+}
|
|
280
|
+
|
|
281
|
+function navigatorSwitchToTab(navigator, params) {
|
|
282
|
+ const controllerID = navigator.navigatorID.split('_')[0];
|
|
283
|
+ if (params.tabIndex || params.tabIndex === 0) {
|
|
284
|
+ Controllers.TabBarControllerIOS(controllerID + '_tabs').switchTo({
|
|
285
|
+ tabIndex: params.tabIndex
|
|
286
|
+ });
|
|
287
|
+ } else {
|
|
288
|
+ Controllers.TabBarControllerIOS(controllerID + '_tabs').switchTo({
|
|
289
|
+ contentId: navigator.navigatorID,
|
|
290
|
+ contentType: 'NavigationControllerIOS'
|
|
291
|
+ });
|
|
292
|
+ }
|
|
293
|
+}
|
|
294
|
+
|
254
|
295
|
function navigatorSetButtons(navigator, navigatorEventID, params) {
|
255
|
296
|
if (params.leftButtons) {
|
256
|
297
|
const buttons = params.leftButtons.slice(); // clone
|
|
@@ -319,5 +360,8 @@ export default {
|
319
|
360
|
dismissModal,
|
320
|
361
|
navigatorSetButtons,
|
321
|
362
|
navigatorSetTitle,
|
322
|
|
- navigatorToggleDrawer
|
|
363
|
+ navigatorToggleDrawer,
|
|
364
|
+ navigatorToggleTabs,
|
|
365
|
+ navigatorSetTabBadge,
|
|
366
|
+ navigatorSwitchToTab
|
323
|
367
|
}
|