Daniel Zlotin 8 vuotta sitten
vanhempi
commit
0059b12217

+ 1
- 1
src/Navigation.js Näytä tiedosto

@@ -1,6 +1,6 @@
1 1
 import React from 'react';
2 2
 import {AppRegistry} from 'react-native';
3
-import platformSpecific from './platformSpecificDeprecated';
3
+import platformSpecific from './deprecated/platformSpecificDeprecated';
4 4
 import Screen from './Screen';
5 5
 
6 6
 const registeredScreens = {};

+ 1
- 1
src/Screen.js Näytä tiedosto

@@ -4,7 +4,7 @@ import {
4 4
   DeviceEventEmitter,
5 5
   Platform
6 6
 } from 'react-native';
7
-import platformSpecific from './platformSpecificDeprecated';
7
+import platformSpecific from './deprecated/platformSpecificDeprecated';
8 8
 import Navigation from './Navigation';
9 9
 
10 10
 const _allNavigatorEventHandlers = {};

src/platformSpecificDeprecated.android.js → src/deprecated/platformSpecificDeprecated.android.js Näytä tiedosto

@@ -3,11 +3,11 @@ import {AppRegistry, NativeModules} from 'react-native';
3 3
 import _ from 'lodash';
4 4
 import utils from './utils';
5 5
 
6
-import Navigation from './Navigation';
6
+import Navigation from './../Navigation';
7 7
 
8 8
 const resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource');
9 9
 
10
-import * as newPlatformSpecific from './platformSpecific';
10
+import * as newPlatformSpecific from './../platformSpecific';
11 11
 
12 12
 function startSingleScreenApp(params) {
13 13
   const screen = params.screen;

src/platformSpecificDeprecated.ios.js → src/deprecated/platformSpecificDeprecated.ios.js Näytä tiedosto

@@ -1,6 +1,6 @@
1 1
 import utils from './utils';
2
-import Navigation from './Navigation';
3
-import Controllers, { Modal, Notification } from 'react-native-controllers';
2
+import Navigation from './../Navigation';
3
+import Controllers, {Modal, Notification} from 'react-native-controllers';
4 4
 const React = Controllers.hijackReact();
5 5
 const {
6 6
   ControllerRegistry,
@@ -23,13 +23,13 @@ function startTabBasedApp(params) {
23 23
         const navigatorID = controllerID + '_drawer';
24 24
         return (
25 25
           <DrawerControllerIOS id={navigatorID}
26
-            componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
27
-            passPropsLeft={{navigatorID: navigatorID}}
28
-            componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
29
-            passPropsRight={{navigatorID: navigatorID}}
30
-            disableOpenGesture={params.drawer.disableOpenGesture}
31
-            type={params.drawer.type ? params.drawer.type : undefined}
32
-            animationType={params.drawer.animationType ? params.drawer.animationType : undefined}
26
+                               componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
27
+                               passPropsLeft={{navigatorID: navigatorID}}
28
+                               componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
29
+                               passPropsRight={{navigatorID: navigatorID}}
30
+                               disableOpenGesture={params.drawer.disableOpenGesture}
31
+                               type={params.drawer.type ? params.drawer.type : undefined}
32
+                               animationType={params.drawer.animationType ? params.drawer.animationType : undefined}
33 33
           >
34 34
             {this.renderBody()}
35 35
           </DrawerControllerIOS>
@@ -42,38 +42,38 @@ function startTabBasedApp(params) {
42 42
           id={controllerID + '_tabs'}
43 43
           style={params.tabsStyle}>
44 44
           {
45
-          params.tabs.map(function(tab, index) {
46
-            const navigatorID = controllerID + '_nav' + index;
47
-            const screenInstanceID = utils.getRandomId();
48
-            if (!tab.screen) {
49
-              console.error('startTabBasedApp(params): every tab must include a screen property, take a look at tab#' + (index+1));
50
-              return;
51
-            }
52
-            const {
53
-              navigatorStyle,
54
-              navigatorButtons,
55
-              navigatorEventID
56
-            } = _mergeScreenSpecificSettings(tab.screen, screenInstanceID, tab);
57
-            return (
58
-              <TabBarControllerIOS.Item {...tab} title={tab.label}>
59
-                <NavigationControllerIOS
60
-                  id={navigatorID}
61
-                  title={tab.title}
62
-                  titleImage={tab.titleImage}
63
-                  component={tab.screen}
64
-                  passProps={{
45
+            params.tabs.map(function(tab, index) {
46
+              const navigatorID = controllerID + '_nav' + index;
47
+              const screenInstanceID = utils.getRandomId();
48
+              if (!tab.screen) {
49
+                console.error('startTabBasedApp(params): every tab must include a screen property, take a look at tab#' + (index + 1));
50
+                return;
51
+              }
52
+              const {
53
+                navigatorStyle,
54
+                navigatorButtons,
55
+                navigatorEventID
56
+              } = _mergeScreenSpecificSettings(tab.screen, screenInstanceID, tab);
57
+              return (
58
+                <TabBarControllerIOS.Item {...tab} title={tab.label}>
59
+                  <NavigationControllerIOS
60
+                    id={navigatorID}
61
+                    title={tab.title}
62
+                    titleImage={tab.titleImage}
63
+                    component={tab.screen}
64
+                    passProps={{
65 65
                     navigatorID: navigatorID,
66 66
                     screenInstanceID: screenInstanceID,
67 67
                     navigatorEventID: navigatorEventID
68 68
                   }}
69
-                  style={navigatorStyle}
70
-                  leftButtons={navigatorButtons.leftButtons}
71
-                  rightButtons={navigatorButtons.rightButtons}
72
-                />
73
-              </TabBarControllerIOS.Item>
74
-            );
75
-          })
76
-        }
69
+                    style={navigatorStyle}
70
+                    leftButtons={navigatorButtons.leftButtons}
71
+                    rightButtons={navigatorButtons.rightButtons}
72
+                  />
73
+                </TabBarControllerIOS.Item>
74
+              );
75
+            })
76
+          }
77 77
         </TabBarControllerIOS>
78 78
       );
79 79
     }
@@ -96,11 +96,11 @@ function startSingleScreenApp(params) {
96 96
         const navigatorID = controllerID + '_drawer';
97 97
         return (
98 98
           <DrawerControllerIOS id={navigatorID}
99
-            componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
100
-            passPropsLeft={{navigatorID: navigatorID}}
101
-            componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
102
-            passPropsRight={{navigatorID: navigatorID}}
103
-            disableOpenGesture={params.drawer.disableOpenGesture}>
99
+                               componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
100
+                               passPropsLeft={{navigatorID: navigatorID}}
101
+                               componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
102
+                               passPropsRight={{navigatorID: navigatorID}}
103
+                               disableOpenGesture={params.drawer.disableOpenGesture}>
104 104
             {this.renderBody()}
105 105
           </DrawerControllerIOS>
106 106
         );
@@ -158,16 +158,16 @@ function _mergeScreenSpecificSettings(screenID, screenInstanceID, params) {
158 158
     Object.assign(navigatorButtons, params.navigatorButtons);
159 159
   }
160 160
   if (navigatorButtons.leftButtons) {
161
-    for (let i = 0 ; i < navigatorButtons.leftButtons.length ; i++) {
161
+    for (let i = 0; i < navigatorButtons.leftButtons.length; i++) {
162 162
       navigatorButtons.leftButtons[i].onPress = navigatorEventID;
163 163
     }
164 164
   }
165 165
   if (navigatorButtons.rightButtons) {
166
-    for (let i = 0 ; i < navigatorButtons.rightButtons.length ; i++) {
166
+    for (let i = 0; i < navigatorButtons.rightButtons.length; i++) {
167 167
       navigatorButtons.rightButtons[i].onPress = navigatorEventID;
168 168
     }
169 169
   }
170
-  return { navigatorStyle, navigatorButtons, navigatorEventID };
170
+  return {navigatorStyle, navigatorButtons, navigatorEventID};
171 171
 }
172 172
 
173 173
 function navigatorPush(navigator, params) {
@@ -318,14 +318,14 @@ function navigatorSwitchToTab(navigator, params) {
318 318
 function navigatorSetButtons(navigator, navigatorEventID, params) {
319 319
   if (params.leftButtons) {
320 320
     const buttons = params.leftButtons.slice(); // clone
321
-    for (let i = 0 ; i < buttons.length ; i++) {
321
+    for (let i = 0; i < buttons.length; i++) {
322 322
       buttons[i].onPress = navigatorEventID;
323 323
     }
324 324
     Controllers.NavigationControllerIOS(navigator.navigatorID).setLeftButtons(buttons, params.animated);
325 325
   }
326 326
   if (params.rightButtons) {
327 327
     const buttons = params.rightButtons.slice(); // clone
328
-    for (let i = 0 ; i < buttons.length ; i++) {
328
+    for (let i = 0; i < buttons.length; i++) {
329 329
       buttons[i].onPress = navigatorEventID;
330 330
     }
331 331
     Controllers.NavigationControllerIOS(navigator.navigatorID).setRightButtons(buttons, params.animated);

src/utils.js → src/deprecated/utils.js Näytä tiedosto