Browse Source

fix example

Gaëtan Renaudeau 7 years ago
parent
commit
773f5d2d37

+ 6
- 0
android/react-native-view-shot.iml View File

77
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
77
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
78
       <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
78
       <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
79
       <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
79
       <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
80
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
80
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
81
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
81
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
82
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
83
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
82
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
84
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
85
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
86
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
83
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
87
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
84
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
88
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
85
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
89
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
86
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
90
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
87
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
91
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
88
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
92
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
93
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
89
       <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
94
       <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
95
+      <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
90
     </content>
96
     </content>
91
     <orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />
97
     <orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />
92
     <orderEntry type="sourceFolder" forTests="false" />
98
     <orderEntry type="sourceFolder" forTests="false" />

+ 6
- 3
example/App.js View File

53
       snapshotContentContainer: false
53
       snapshotContentContainer: false
54
     }
54
     }
55
   };
55
   };
56
-  
56
+
57
   snapshot = refname => () =>
57
   snapshot = refname => () =>
58
-    (refname ? captureRef(this.refs[refname], this.state.value) : captureScreen(this.state.value))
58
+    (refname
59
+      ? captureRef(this.refs[refname], this.state.value)
60
+      : captureScreen(this.state.value)
61
+    )
59
       .then(
62
       .then(
60
         res =>
63
         res =>
61
           this.state.value.result !== "tmpfile"
64
           this.state.value.result !== "tmpfile"
149
             <Btn label="📷 MapView" onPress={this.snapshot("mapview")} />
152
             <Btn label="📷 MapView" onPress={this.snapshot("mapview")} />
150
             <Btn label="📷 WebView" onPress={this.snapshot("webview")} />
153
             <Btn label="📷 WebView" onPress={this.snapshot("webview")} />
151
             <Btn label="📷 Video" onPress={this.snapshot("video")} />
154
             <Btn label="📷 Video" onPress={this.snapshot("video")} />
152
-            <Btn label="📷 Native Screenshot" onPress={this.snapshot()}/>
155
+            <Btn label="📷 Native Screenshot" onPress={this.snapshot()} />
153
             <Btn
156
             <Btn
154
               label="📷 Empty View (should crash)"
157
               label="📷 Empty View (should crash)"
155
               onPress={this.snapshot("empty")}
158
               onPress={this.snapshot("empty")}

+ 10
- 0
example/ios/ViewShotExample.xcodeproj/project.pbxproj View File

475
 			name = Products;
475
 			name = Products;
476
 			sourceTree = "<group>";
476
 			sourceTree = "<group>";
477
 		};
477
 		};
478
+		34FEAEFB1F779AA000EAD7B5 /* Recovered References */ = {
479
+			isa = PBXGroup;
480
+			children = (
481
+				79F086C5FD034CB6AFA5417A /* libRCTVideo.a */,
482
+				AD1B20B979EC412D9AD1D350 /* libRNSVG.a */,
483
+			);
484
+			name = "Recovered References";
485
+			sourceTree = "<group>";
486
+		};
478
 		5E91572E1DD0AC6500FF2AA8 /* Products */ = {
487
 		5E91572E1DD0AC6500FF2AA8 /* Products */ = {
479
 			isa = PBXGroup;
488
 			isa = PBXGroup;
480
 			children = (
489
 			children = (
531
 				13B07FAE1A68108700A75B9A /* ViewShotExample */,
540
 				13B07FAE1A68108700A75B9A /* ViewShotExample */,
532
 				832341AE1AAA6A7D00B99B32 /* Libraries */,
541
 				832341AE1AAA6A7D00B99B32 /* Libraries */,
533
 				83CBBA001A601CBA00E9B192 /* Products */,
542
 				83CBBA001A601CBA00E9B192 /* Products */,
543
+				34FEAEFB1F779AA000EAD7B5 /* Recovered References */,
534
 			);
544
 			);
535
 			indentWidth = 2;
545
 			indentWidth = 2;
536
 			sourceTree = "<group>";
546
 			sourceTree = "<group>";

+ 1
- 1
example/package.json View File

15
     "react-native": "^0.47.0",
15
     "react-native": "^0.47.0",
16
     "react-native-maps": "^0.16.2",
16
     "react-native-maps": "^0.16.2",
17
     "react-native-svg": "^5.4.1",
17
     "react-native-svg": "^5.4.1",
18
-    "react-native-svg-uri": "^1.2.1",
18
+    "react-native-svg-uri": "github:gre/react-native-svg-uri#onLoad",
19
     "react-native-video": "^2.0.0",
19
     "react-native-video": "^2.0.0",
20
     "react-native-view-shot": "file:..",
20
     "react-native-view-shot": "file:..",
21
     "react-native-windows": "^0.47.0-rc.4"
21
     "react-native-windows": "^0.47.0-rc.4"