Browse Source

Update example app to rn51

Guy Carmeli 6 years ago
parent
commit
0f4eaa417b

+ 6
- 0
example/android/app/src/main/java/com/example/MainApplication.java View File

18
     public List<ReactPackage> createAdditionalReactPackages() {
18
     public List<ReactPackage> createAdditionalReactPackages() {
19
         return null;
19
         return null;
20
     }
20
     }
21
+
22
+    @Nullable
23
+    @Override
24
+    public String getJSMainModuleName() {
25
+        return "index";
26
+    }
21
 }
27
 }

+ 0
- 1
example/index.ios.js View File

1
-import App from './src/app';

example/index.android.js → example/index.js View File


+ 121
- 1
example/ios/example.xcodeproj/project.pbxproj View File

216
 			remoteGlobalIDString = 58B5119B1A9E6C1200147676;
216
 			remoteGlobalIDString = 58B5119B1A9E6C1200147676;
217
 			remoteInfo = RCTText;
217
 			remoteInfo = RCTText;
218
 		};
218
 		};
219
+		E5E62BA91FFA2FF40025960D /* PBXContainerItemProxy */ = {
220
+			isa = PBXContainerItemProxy;
221
+			containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
222
+			proxyType = 2;
223
+			remoteGlobalIDString = 3DBE0D001F3B181A0099AA32;
224
+			remoteInfo = fishhook;
225
+		};
226
+		E5E62BAB1FFA2FF40025960D /* PBXContainerItemProxy */ = {
227
+			isa = PBXContainerItemProxy;
228
+			containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
229
+			proxyType = 2;
230
+			remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
231
+			remoteInfo = "fishhook-tvOS";
232
+		};
233
+		E5E62BBB1FFA2FF40025960D /* PBXContainerItemProxy */ = {
234
+			isa = PBXContainerItemProxy;
235
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
236
+			proxyType = 2;
237
+			remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
238
+			remoteInfo = "third-party";
239
+		};
240
+		E5E62BBD1FFA2FF40025960D /* PBXContainerItemProxy */ = {
241
+			isa = PBXContainerItemProxy;
242
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
243
+			proxyType = 2;
244
+			remoteGlobalIDString = 3D383D3C1EBD27B6005632C8;
245
+			remoteInfo = "third-party-tvOS";
246
+		};
247
+		E5E62BBF1FFA2FF40025960D /* PBXContainerItemProxy */ = {
248
+			isa = PBXContainerItemProxy;
249
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
250
+			proxyType = 2;
251
+			remoteGlobalIDString = 139D7E881E25C6D100323FB7;
252
+			remoteInfo = "double-conversion";
253
+		};
254
+		E5E62BC11FFA2FF40025960D /* PBXContainerItemProxy */ = {
255
+			isa = PBXContainerItemProxy;
256
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
257
+			proxyType = 2;
258
+			remoteGlobalIDString = 3D383D621EBD27B9005632C8;
259
+			remoteInfo = "double-conversion-tvOS";
260
+		};
261
+		E5E62BC31FFA2FF40025960D /* PBXContainerItemProxy */ = {
262
+			isa = PBXContainerItemProxy;
263
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
264
+			proxyType = 2;
265
+			remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
266
+			remoteInfo = privatedata;
267
+		};
268
+		E5E62BC51FFA2FF40025960D /* PBXContainerItemProxy */ = {
269
+			isa = PBXContainerItemProxy;
270
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
271
+			proxyType = 2;
272
+			remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
273
+			remoteInfo = "privatedata-tvOS";
274
+		};
219
 /* End PBXContainerItemProxy section */
275
 /* End PBXContainerItemProxy section */
220
 
276
 
221
 /* Begin PBXFileReference section */
277
 /* Begin PBXFileReference section */
347
 			children = (
403
 			children = (
348
 				139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
404
 				139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
349
 				7B9B397F1DEB4076004A6281 /* libRCTWebSocket-tvOS.a */,
405
 				7B9B397F1DEB4076004A6281 /* libRCTWebSocket-tvOS.a */,
406
+				E5E62BAA1FFA2FF40025960D /* libfishhook.a */,
407
+				E5E62BAC1FFA2FF40025960D /* libfishhook-tvOS.a */,
350
 			);
408
 			);
351
 			name = Products;
409
 			name = Products;
352
 			sourceTree = "<group>";
410
 			sourceTree = "<group>";
376
 				7BFF942D1E5F10F20054957C /* libcxxreact.a */,
434
 				7BFF942D1E5F10F20054957C /* libcxxreact.a */,
377
 				7BFF942F1E5F10F20054957C /* libjschelpers.a */,
435
 				7BFF942F1E5F10F20054957C /* libjschelpers.a */,
378
 				7BFF94311E5F10F20054957C /* libjschelpers.a */,
436
 				7BFF94311E5F10F20054957C /* libjschelpers.a */,
437
+				E5E62BBC1FFA2FF40025960D /* libthird-party.a */,
438
+				E5E62BBE1FFA2FF40025960D /* libthird-party.a */,
439
+				E5E62BC01FFA2FF40025960D /* libdouble-conversion.a */,
440
+				E5E62BC21FFA2FF40025960D /* libdouble-conversion.a */,
441
+				E5E62BC41FFA2FF40025960D /* libprivatedata.a */,
442
+				E5E62BC61FFA2FF40025960D /* libprivatedata-tvOS.a */,
379
 			);
443
 			);
380
 			name = Products;
444
 			name = Products;
381
 			sourceTree = "<group>";
445
 			sourceTree = "<group>";
761
 			remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
825
 			remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
762
 			sourceTree = BUILT_PRODUCTS_DIR;
826
 			sourceTree = BUILT_PRODUCTS_DIR;
763
 		};
827
 		};
828
+		E5E62BAA1FFA2FF40025960D /* libfishhook.a */ = {
829
+			isa = PBXReferenceProxy;
830
+			fileType = archive.ar;
831
+			path = libfishhook.a;
832
+			remoteRef = E5E62BA91FFA2FF40025960D /* PBXContainerItemProxy */;
833
+			sourceTree = BUILT_PRODUCTS_DIR;
834
+		};
835
+		E5E62BAC1FFA2FF40025960D /* libfishhook-tvOS.a */ = {
836
+			isa = PBXReferenceProxy;
837
+			fileType = archive.ar;
838
+			path = "libfishhook-tvOS.a";
839
+			remoteRef = E5E62BAB1FFA2FF40025960D /* PBXContainerItemProxy */;
840
+			sourceTree = BUILT_PRODUCTS_DIR;
841
+		};
842
+		E5E62BBC1FFA2FF40025960D /* libthird-party.a */ = {
843
+			isa = PBXReferenceProxy;
844
+			fileType = archive.ar;
845
+			path = "libthird-party.a";
846
+			remoteRef = E5E62BBB1FFA2FF40025960D /* PBXContainerItemProxy */;
847
+			sourceTree = BUILT_PRODUCTS_DIR;
848
+		};
849
+		E5E62BBE1FFA2FF40025960D /* libthird-party.a */ = {
850
+			isa = PBXReferenceProxy;
851
+			fileType = archive.ar;
852
+			path = "libthird-party.a";
853
+			remoteRef = E5E62BBD1FFA2FF40025960D /* PBXContainerItemProxy */;
854
+			sourceTree = BUILT_PRODUCTS_DIR;
855
+		};
856
+		E5E62BC01FFA2FF40025960D /* libdouble-conversion.a */ = {
857
+			isa = PBXReferenceProxy;
858
+			fileType = archive.ar;
859
+			path = "libdouble-conversion.a";
860
+			remoteRef = E5E62BBF1FFA2FF40025960D /* PBXContainerItemProxy */;
861
+			sourceTree = BUILT_PRODUCTS_DIR;
862
+		};
863
+		E5E62BC21FFA2FF40025960D /* libdouble-conversion.a */ = {
864
+			isa = PBXReferenceProxy;
865
+			fileType = archive.ar;
866
+			path = "libdouble-conversion.a";
867
+			remoteRef = E5E62BC11FFA2FF40025960D /* PBXContainerItemProxy */;
868
+			sourceTree = BUILT_PRODUCTS_DIR;
869
+		};
870
+		E5E62BC41FFA2FF40025960D /* libprivatedata.a */ = {
871
+			isa = PBXReferenceProxy;
872
+			fileType = archive.ar;
873
+			path = libprivatedata.a;
874
+			remoteRef = E5E62BC31FFA2FF40025960D /* PBXContainerItemProxy */;
875
+			sourceTree = BUILT_PRODUCTS_DIR;
876
+		};
877
+		E5E62BC61FFA2FF40025960D /* libprivatedata-tvOS.a */ = {
878
+			isa = PBXReferenceProxy;
879
+			fileType = archive.ar;
880
+			path = "libprivatedata-tvOS.a";
881
+			remoteRef = E5E62BC51FFA2FF40025960D /* PBXContainerItemProxy */;
882
+			sourceTree = BUILT_PRODUCTS_DIR;
883
+		};
764
 /* End PBXReferenceProxy section */
884
 /* End PBXReferenceProxy section */
765
 
885
 
766
 /* Begin PBXResourcesBuildPhase section */
886
 /* Begin PBXResourcesBuildPhase section */
795
 			);
915
 			);
796
 			runOnlyForDeploymentPostprocessing = 0;
916
 			runOnlyForDeploymentPostprocessing = 0;
797
 			shellPath = /bin/sh;
917
 			shellPath = /bin/sh;
798
-			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
918
+			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
799
 		};
919
 		};
800
 /* End PBXShellScriptBuildPhase section */
920
 /* End PBXShellScriptBuildPhase section */
801
 
921
 

+ 2
- 2
example/ios/example/AppDelegate.m View File

17
 {
17
 {
18
   NSURL *jsCodeLocation;
18
   NSURL *jsCodeLocation;
19
 #ifdef DEBUG
19
 #ifdef DEBUG
20
-//  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
21
-  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
20
+//  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.bundle?platform=ios&dev=true"];
21
+  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
22
 #else
22
 #else
23
    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
23
    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
24
 #endif
24
 #endif

+ 2
- 2
example/package.json View File

11
     "e2e-release": "detox test --configuration ios.sim.release"
11
     "e2e-release": "detox test --configuration ios.sim.release"
12
   },
12
   },
13
   "dependencies": {
13
   "dependencies": {
14
-    "react": "16.0.0-alpha.12",
15
-    "react-native": "0.45.1",
14
+    "react": "16.0.0",
15
+    "react-native": "0.51.0",
16
     "react-native-animatable": "^1.1.0",
16
     "react-native-animatable": "^1.1.0",
17
     "react-native-navigation": "latest"
17
     "react-native-navigation": "latest"
18
   },
18
   },

+ 18
- 18
example/src/screens/Actions.js View File

1
 import React from 'react';
1
 import React from 'react';
2
-import { StyleSheet, ScrollView } from 'react-native';
2
+import {StyleSheet, ScrollView} from 'react-native';
3
 import Row from '../components/Row';
3
 import Row from '../components/Row';
4
 
4
 
5
 class Actions extends React.Component {
5
 class Actions extends React.Component {
23
 
23
 
24
   setTitle = () => {
24
   setTitle = () => {
25
     this.props.navigator.setTitle({
25
     this.props.navigator.setTitle({
26
-      title: 'New Title!',
26
+      title: 'New Title!'
27
     });
27
     });
28
   };
28
   };
29
 
29
 
41
 
41
 
42
     this.props.navigator.toggleTabs({
42
     this.props.navigator.toggleTabs({
43
       to,
43
       to,
44
-      animated: true,
44
+      animated: true
45
     });
45
     });
46
     this._toggleTabs = to;
46
     this._toggleTabs = to;
47
   };
47
   };
49
   setTabBadge = () => {
49
   setTabBadge = () => {
50
     this.props.navigator.setTabBadge({
50
     this.props.navigator.setTabBadge({
51
       tabIndex: 1,
51
       tabIndex: 1,
52
-      badge: Math.floor(Math.random() * 20) + 1,
52
+      badge: Math.floor(Math.random() * 20) + 1
53
     });
53
     });
54
   };
54
   };
55
 
55
 
56
   switchToTab = () => {
56
   switchToTab = () => {
57
     this.props.navigator.switchToTab({
57
     this.props.navigator.switchToTab({
58
-      tabIndex: 0,
58
+      tabIndex: 0
59
     });
59
     });
60
   };
60
   };
61
 
61
 
64
 
64
 
65
     this.props.navigator.toggleNavBar({
65
     this.props.navigator.toggleNavBar({
66
       to,
66
       to,
67
-      animated: true,
67
+      animated: true
68
     });
68
     });
69
     this._toggleNavBar = to;
69
     this._toggleNavBar = to;
70
   };
70
   };
71
 
71
 
72
   showSnackbar = () => {
72
   showSnackbar = () => {
73
     this.props.navigator.showSnackbar({
73
     this.props.navigator.showSnackbar({
74
-      text: 'Woo Snacks!',
74
+      text: 'Woo Snacks!'
75
     });
75
     });
76
   };
76
   };
77
 
77
 
80
       this.props.navigator.showContextualMenu({
80
       this.props.navigator.showContextualMenu({
81
         rightButtons: [{
81
         rightButtons: [{
82
           title: 'Edit',
82
           title: 'Edit',
83
-          icon: require('../../img/edit.png'),
83
+          icon: require('../../img/edit.png')
84
         }, {
84
         }, {
85
           title: 'Delete',
85
           title: 'Delete',
86
-          icon: require('../../img/delete.png'),
86
+          icon: require('../../img/delete.png')
87
         }],
87
         }],
88
         onButtonPressed: (index) => console.log(`Button ${index} tapped`)
88
         onButtonPressed: (index) => console.log(`Button ${index} tapped`)
89
       });
89
       });
107
     this.props.navigator.setButtons({
107
     this.props.navigator.setButtons({
108
       rightButtons: [{
108
       rightButtons: [{
109
         title,
109
         title,
110
-        id: 'topRight',
110
+        id: 'topRight'
111
       }],
111
       }],
112
-      animated: true,
112
+      animated: true
113
     });
113
     });
114
     this._rightButton = title;
114
     this._rightButton = title;
115
   };
115
   };
117
   toggleFAB = () => {
117
   toggleFAB = () => {
118
     if (this._fab) {
118
     if (this._fab) {
119
       this.props.navigator.setButtons({
119
       this.props.navigator.setButtons({
120
-        fab: {},
120
+        fab: {}
121
       });
121
       });
122
       this._fab = false;
122
       this._fab = false;
123
     } else {
123
     } else {
124
       this.props.navigator.setButtons({
124
       this.props.navigator.setButtons({
125
         fab: {
125
         fab: {
126
           collapsedId: 'share',
126
           collapsedId: 'share',
127
-          collapsedIcon: require('../../img/edit@1x.png'),
127
+          collapsedIcon: require('../../img/edit.png'),
128
           expendedId: 'clear',
128
           expendedId: 'clear',
129
-          expendedIcon: require('../../img/edit@1x.png'),
129
+          expendedIcon: require('../../img/edit.png'),
130
           backgroundColor: '#ff505c',
130
           backgroundColor: '#ff505c',
131
           actions: [
131
           actions: [
132
             {
132
             {
133
               id: 'mail',
133
               id: 'mail',
134
-              icon: require('../../img/edit@1x.png'),
134
+              icon: require('../../img/edit.png'),
135
               backgroundColor: '#03A9F4'
135
               backgroundColor: '#03A9F4'
136
             },
136
             },
137
             {
137
             {
138
               id: 'delete',
138
               id: 'delete',
139
-              icon: require('../../img/delete@1x.png'),
139
+              icon: require('../../img/delete.png'),
140
               backgroundColor: '#4CAF50'
140
               backgroundColor: '#4CAF50'
141
             }
141
             }
142
           ]
142
           ]
143
         },
143
         },
144
-        animated: true,
144
+        animated: true
145
       });
145
       });
146
       this._fab = true;
146
       this._fab = true;
147
     }
147
     }
166
 }
166
 }
167
 
167
 
168
 const styles = StyleSheet.create({
168
 const styles = StyleSheet.create({
169
-  container: {},
169
+  container: {}
170
 });
170
 });
171
 
171
 
172
 export default Actions;
172
 export default Actions;