-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
85 lines (80 loc) · 1.89 KB
/
Copy pathApp.js
File metadata and controls
85 lines (80 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { StatusBar } from "expo-status-bar";
import React, { useEffect } from "react";
import { Button, StyleSheet, Text, View } from "react-native";
import AnylineOCR from "anyline-ocr-react-native-module";
export default function App() {
const anylineLicenseKey = "==== INSERT ANYLINE LICENSE KEY HERE ===";
const init = async () => {
try {
await AnylineOCR.setupAnylineSDK(anylineLicenseKey);
} catch (error) {
console.log("error initializing Anyline SDK: " + error);
}
};
useEffect(() => {
init();
}, []);
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
<Button onPress={() => AnylineOCR.scan(anyLineConfig)} title="Scan" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
const anyLineConfig = {
options: {
doneButtonConfig: {
"offset.y": -88,
},
},
cameraConfig: {
captureResolution: "1080p",
zoomGesture: true,
},
flashConfig: {
mode: "manual",
alignment: "top_left",
},
viewPluginConfig: {
pluginConfig: {
id: "tire-make",
cancelOnResult: true,
tireMakeConfig: {
upsideDownMode: "AUTO",
},
},
cutoutConfig: {
maxWidthPercent: "60%",
maxHeightPercent: "60%",
alignment: "center",
strokeWidth: 2,
cornerRadius: 4,
strokeColor: "0099FF",
outerColor: "000000",
outerAlpha: 0.3,
ratioFromSize: {
width: 5,
height: 2,
},
feedbackStrokeColor: "0099FF",
},
scanFeedbackConfig: {
animation: "traverse_multi",
animationDuration: 250,
style: "rect",
strokeColor: "0099FF",
beepOnResult: true,
vibrateOnResult: false,
strokeWidth: 2,
},
},
};