ソースを参照

Update example app to rn51

Guy Carmeli 6 年 前
コミット
0f4eaa417b

+ 6
- 0
example/android/app/src/main/java/com/example/MainApplication.java ファイルの表示

@@ -18,4 +18,10 @@ public class MainApplication extends NavigationApplication {
18 18
     public List<ReactPackage> createAdditionalReactPackages() {
19 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 ファイルの表示

@@ -1 +0,0 @@
1
-import App from './src/app';

example/index.android.js → example/index.js ファイルの表示


+ 121
- 1
example/ios/example.xcodeproj/project.pbxproj ファイルの表示

@@ -216,6 +216,62 @@
216 216
 			remoteGlobalIDString = 58B5119B1A9E6C1200147676;
217 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 275
 /* End PBXContainerItemProxy section */
220 276
 
221 277
 /* Begin PBXFileReference section */
@@ -347,6 +403,8 @@
347 403
 			children = (
348 404
 				139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
349 405
 				7B9B397F1DEB4076004A6281 /* libRCTWebSocket-tvOS.a */,
406
+				E5E62BAA1FFA2FF40025960D /* libfishhook.a */,
407
+				E5E62BAC1FFA2FF40025960D /* libfishhook-tvOS.a */,
350 408
 			);
351 409
 			name = Products;
352 410
 			sourceTree = "<group>";
@@ -376,6 +434,12 @@
376 434
 				7BFF942D1E5F10F20054957C /* libcxxreact.a */,
377 435
 				7BFF942F1E5F10F20054957C /* libjschelpers.a */,
378 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 444
 			name = Products;
381 445
 			sourceTree = "<group>";
@@ -761,6 +825,62 @@
761 825
 			remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
762 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 884
 /* End PBXReferenceProxy section */
765 885
 
766 886
 /* Begin PBXResourcesBuildPhase section */
@@ -795,7 +915,7 @@
795 915
 			);
796 916
 			runOnlyForDeploymentPostprocessing = 0;
797 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 920
 /* End PBXShellScriptBuildPhase section */
801 921
 

+ 2
- 2
example/ios/example/AppDelegate.m ファイルの表示

@@ -17,8 +17,8 @@
17 17
 {
18 18
   NSURL *jsCodeLocation;
19 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 22
 #else
23 23
    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
24 24
 #endif

+ 2
- 2
example/package.json ファイルの表示

@@ -11,8 +11,8 @@
11 11
     "e2e-release": "detox test --configuration ios.sim.release"
12 12
   },
13 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 16
     "react-native-animatable": "^1.1.0",
17 17
     "react-native-navigation": "latest"
18 18
   },

+ 18
- 18
example/src/screens/Actions.js ファイルの表示

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