anyline-ocr-react-native-module 43.0.1 → 44.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +9 -1
- package/android/gradle/wrapper/gradle-wrapper.properties +2 -2
- package/android/gradlew +192 -108
- package/android/gradlew.bat +10 -7
- package/android/src/main/assets/info_sound_TIN.wav +0 -0
- package/android/src/main/java/com/anyline/reactnative/FeedbackConfig.java +58 -0
- package/android/src/main/java/com/anyline/reactnative/ImageTextConfig.java +48 -0
- package/android/src/main/java/com/anyline/reactnative/InstructionConfig.java +19 -0
- package/android/src/main/java/com/anyline/reactnative/ScanActivity.java +180 -1
- package/android/src/main/res/drawable/dot_overlay.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_flash_auto.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_flash_off.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_flash_on.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_move_back.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_move_closer.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_too_bright.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_too_dark.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_wrong_format.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_flash_auto.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_flash_off.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_flash_on.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_move_back.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_move_closer.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_too_bright.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_too_dark.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_wrong_format.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_flash_auto.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_flash_off.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_flash_on.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_move_back.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_move_closer.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_too_bright.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_too_dark.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_wrong_format.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_flash_auto.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_flash_off.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_flash_on.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_move_back.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_move_closer.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_too_bright.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_too_dark.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_wrong_format.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_flash_auto.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_flash_off.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_flash_on.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_move_back.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_move_closer.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_too_bright.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_too_dark.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_wrong_format.png +0 -0
- package/android/src/main/res/layout/activity_scan.xml +53 -2
- package/ios/ALJsonUIConfiguration.m +3 -1
- package/ios/ALNFCScanViewController.m +0 -10
- package/ios/ALPluginHelper.m +9 -23
- package/ios/ALPluginScanViewController.h +0 -2
- package/ios/ALPluginScanViewController.m +0 -1
- package/ios/AnylineReact.podspec +2 -2
- package/ios/AnylineSDKPlugin.m +1 -2
- package/package.json +8 -8
package/android/build.gradle
CHANGED
|
@@ -69,8 +69,16 @@ repositories {
|
|
|
69
69
|
|
|
70
70
|
dependencies {
|
|
71
71
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
72
|
-
implementation 'io.anyline:anylinesdk:
|
|
72
|
+
implementation 'io.anyline:anylinesdk:44.1.0'
|
|
73
73
|
implementation "com.facebook.react:react-native:+" // from node_modules
|
|
74
74
|
implementation("com.google.android.material:material:1.4.0-rc01")
|
|
75
75
|
implementation 'androidx.multidex:multidex:2.0.1'
|
|
76
|
+
constraints {
|
|
77
|
+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
|
|
78
|
+
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
|
|
79
|
+
}
|
|
80
|
+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
|
|
81
|
+
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
|
|
82
|
+
}
|
|
83
|
+
}
|
|
76
84
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#Thu Aug 17 14:31:23 CEST 2017
|
|
2
1
|
distributionBase=GRADLE_USER_HOME
|
|
3
2
|
distributionPath=wrapper/dists
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
|
4
|
+
networkTimeout=10000
|
|
4
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
6
|
zipStorePath=wrapper/dists
|
|
6
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
|
package/android/gradlew
CHANGED
|
@@ -1,74 +1,129 @@
|
|
|
1
|
-
#!/
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Copyright © 2015-2021 the original authors.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
2
18
|
|
|
3
19
|
##############################################################################
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
20
|
+
#
|
|
21
|
+
# Gradle start up script for POSIX generated by Gradle.
|
|
22
|
+
#
|
|
23
|
+
# Important for running:
|
|
24
|
+
#
|
|
25
|
+
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
|
26
|
+
# noncompliant, but you have some other compliant shell such as ksh or
|
|
27
|
+
# bash, then to run this script, type that shell name before the whole
|
|
28
|
+
# command line, like:
|
|
29
|
+
#
|
|
30
|
+
# ksh Gradle
|
|
31
|
+
#
|
|
32
|
+
# Busybox and similar reduced shells will NOT work, because this script
|
|
33
|
+
# requires all of these POSIX shell features:
|
|
34
|
+
# * functions;
|
|
35
|
+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
|
36
|
+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
|
37
|
+
# * compound commands having a testable exit status, especially «case»;
|
|
38
|
+
# * various built-in commands including «command», «set», and «ulimit».
|
|
39
|
+
#
|
|
40
|
+
# Important for patching:
|
|
41
|
+
#
|
|
42
|
+
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
|
43
|
+
# by Bash, Ksh, etc; in particular arrays are avoided.
|
|
44
|
+
#
|
|
45
|
+
# The "traditional" practice of packing multiple parameters into a
|
|
46
|
+
# space-separated string is a well documented source of bugs and security
|
|
47
|
+
# problems, so this is (mostly) avoided, by progressively accumulating
|
|
48
|
+
# options in "$@", and eventually passing that to Java.
|
|
49
|
+
#
|
|
50
|
+
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
|
51
|
+
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
|
52
|
+
# see the in-line comments for details.
|
|
53
|
+
#
|
|
54
|
+
# There are tweaks for specific operating systems such as AIX, CygWin,
|
|
55
|
+
# Darwin, MinGW, and NonStop.
|
|
56
|
+
#
|
|
57
|
+
# (3) This script is generated from the Groovy template
|
|
58
|
+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
59
|
+
# within the Gradle project.
|
|
60
|
+
#
|
|
61
|
+
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
62
|
+
#
|
|
7
63
|
##############################################################################
|
|
8
64
|
|
|
9
|
-
#
|
|
10
|
-
|
|
65
|
+
# Attempt to set APP_HOME
|
|
66
|
+
|
|
67
|
+
# Resolve links: $0 may be a link
|
|
68
|
+
app_path=$0
|
|
69
|
+
|
|
70
|
+
# Need this for daisy-chained symlinks.
|
|
71
|
+
while
|
|
72
|
+
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
|
73
|
+
[ -h "$app_path" ]
|
|
74
|
+
do
|
|
75
|
+
ls=$( ls -ld "$app_path" )
|
|
76
|
+
link=${ls#*' -> '}
|
|
77
|
+
case $link in #(
|
|
78
|
+
/*) app_path=$link ;; #(
|
|
79
|
+
*) app_path=$APP_HOME$link ;;
|
|
80
|
+
esac
|
|
81
|
+
done
|
|
82
|
+
|
|
83
|
+
# This is normally unused
|
|
84
|
+
# shellcheck disable=SC2034
|
|
85
|
+
APP_BASE_NAME=${0##*/}
|
|
86
|
+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
|
11
87
|
|
|
12
|
-
|
|
13
|
-
|
|
88
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
89
|
+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
14
90
|
|
|
15
91
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
16
|
-
MAX_FD=
|
|
92
|
+
MAX_FD=maximum
|
|
17
93
|
|
|
18
|
-
warn (
|
|
94
|
+
warn () {
|
|
19
95
|
echo "$*"
|
|
20
|
-
}
|
|
96
|
+
} >&2
|
|
21
97
|
|
|
22
|
-
die (
|
|
98
|
+
die () {
|
|
23
99
|
echo
|
|
24
100
|
echo "$*"
|
|
25
101
|
echo
|
|
26
102
|
exit 1
|
|
27
|
-
}
|
|
103
|
+
} >&2
|
|
28
104
|
|
|
29
105
|
# OS specific support (must be 'true' or 'false').
|
|
30
106
|
cygwin=false
|
|
31
107
|
msys=false
|
|
32
108
|
darwin=false
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
;;
|
|
40
|
-
MINGW* )
|
|
41
|
-
msys=true
|
|
42
|
-
;;
|
|
109
|
+
nonstop=false
|
|
110
|
+
case "$( uname )" in #(
|
|
111
|
+
CYGWIN* ) cygwin=true ;; #(
|
|
112
|
+
Darwin* ) darwin=true ;; #(
|
|
113
|
+
MSYS* | MINGW* ) msys=true ;; #(
|
|
114
|
+
NONSTOP* ) nonstop=true ;;
|
|
43
115
|
esac
|
|
44
116
|
|
|
45
|
-
# Attempt to set APP_HOME
|
|
46
|
-
# Resolve links: $0 may be a link
|
|
47
|
-
PRG="$0"
|
|
48
|
-
# Need this for relative symlinks.
|
|
49
|
-
while [ -h "$PRG" ] ; do
|
|
50
|
-
ls=`ls -ld "$PRG"`
|
|
51
|
-
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
52
|
-
if expr "$link" : '/.*' > /dev/null; then
|
|
53
|
-
PRG="$link"
|
|
54
|
-
else
|
|
55
|
-
PRG=`dirname "$PRG"`"/$link"
|
|
56
|
-
fi
|
|
57
|
-
done
|
|
58
|
-
SAVED="`pwd`"
|
|
59
|
-
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
60
|
-
APP_HOME="`pwd -P`"
|
|
61
|
-
cd "$SAVED" >/dev/null
|
|
62
|
-
|
|
63
117
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
64
118
|
|
|
119
|
+
|
|
65
120
|
# Determine the Java command to use to start the JVM.
|
|
66
121
|
if [ -n "$JAVA_HOME" ] ; then
|
|
67
122
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
68
123
|
# IBM's JDK on AIX uses strange locations for the executables
|
|
69
|
-
JAVACMD
|
|
124
|
+
JAVACMD=$JAVA_HOME/jre/sh/java
|
|
70
125
|
else
|
|
71
|
-
JAVACMD
|
|
126
|
+
JAVACMD=$JAVA_HOME/bin/java
|
|
72
127
|
fi
|
|
73
128
|
if [ ! -x "$JAVACMD" ] ; then
|
|
74
129
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
@@ -77,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
|
|
77
132
|
location of your Java installation."
|
|
78
133
|
fi
|
|
79
134
|
else
|
|
80
|
-
JAVACMD=
|
|
135
|
+
JAVACMD=java
|
|
81
136
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
82
137
|
|
|
83
138
|
Please set the JAVA_HOME variable in your environment to match the
|
|
@@ -85,76 +140,105 @@ location of your Java installation."
|
|
|
85
140
|
fi
|
|
86
141
|
|
|
87
142
|
# Increase the maximum file descriptors if we can.
|
|
88
|
-
if
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
143
|
+
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|
144
|
+
case $MAX_FD in #(
|
|
145
|
+
max*)
|
|
146
|
+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
147
|
+
# shellcheck disable=SC3045
|
|
148
|
+
MAX_FD=$( ulimit -H -n ) ||
|
|
149
|
+
warn "Could not query maximum file descriptor limit"
|
|
150
|
+
esac
|
|
151
|
+
case $MAX_FD in #(
|
|
152
|
+
'' | soft) :;; #(
|
|
153
|
+
*)
|
|
154
|
+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
155
|
+
# shellcheck disable=SC3045
|
|
156
|
+
ulimit -n "$MAX_FD" ||
|
|
157
|
+
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
158
|
+
esac
|
|
101
159
|
fi
|
|
102
160
|
|
|
103
|
-
#
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
161
|
+
# Collect all arguments for the java command, stacking in reverse order:
|
|
162
|
+
# * args from the command line
|
|
163
|
+
# * the main class name
|
|
164
|
+
# * -classpath
|
|
165
|
+
# * -D...appname settings
|
|
166
|
+
# * --module-path (only if needed)
|
|
167
|
+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
|
168
|
+
|
|
169
|
+
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
170
|
+
if "$cygwin" || "$msys" ; then
|
|
171
|
+
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
|
172
|
+
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
173
|
+
|
|
174
|
+
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
|
107
175
|
|
|
108
|
-
# For Cygwin, switch paths to Windows format before running java
|
|
109
|
-
if $cygwin ; then
|
|
110
|
-
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
111
|
-
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
112
|
-
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
113
|
-
|
|
114
|
-
# We build the pattern for arguments to be converted via cygpath
|
|
115
|
-
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
116
|
-
SEP=""
|
|
117
|
-
for dir in $ROOTDIRSRAW ; do
|
|
118
|
-
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
119
|
-
SEP="|"
|
|
120
|
-
done
|
|
121
|
-
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
122
|
-
# Add a user-defined pattern to the cygpath arguments
|
|
123
|
-
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
124
|
-
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
125
|
-
fi
|
|
126
176
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
177
|
+
for arg do
|
|
178
|
+
if
|
|
179
|
+
case $arg in #(
|
|
180
|
+
-*) false ;; # don't mess with options #(
|
|
181
|
+
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
|
182
|
+
[ -e "$t" ] ;; #(
|
|
183
|
+
*) false ;;
|
|
184
|
+
esac
|
|
185
|
+
then
|
|
186
|
+
arg=$( cygpath --path --ignore --mixed "$arg" )
|
|
136
187
|
fi
|
|
137
|
-
|
|
188
|
+
# Roll the args list around exactly as many times as the number of
|
|
189
|
+
# args, so each arg winds up back in the position where it started, but
|
|
190
|
+
# possibly modified.
|
|
191
|
+
#
|
|
192
|
+
# NB: a `for` loop captures its iteration list before it begins, so
|
|
193
|
+
# changing the positional parameters here affects neither the number of
|
|
194
|
+
# iterations, nor the values presented in `arg`.
|
|
195
|
+
shift # remove old arg
|
|
196
|
+
set -- "$@" "$arg" # push replacement arg
|
|
138
197
|
done
|
|
139
|
-
case $i in
|
|
140
|
-
(0) set -- ;;
|
|
141
|
-
(1) set -- "$args0" ;;
|
|
142
|
-
(2) set -- "$args0" "$args1" ;;
|
|
143
|
-
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
144
|
-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
145
|
-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
146
|
-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
147
|
-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
148
|
-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
149
|
-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
150
|
-
esac
|
|
151
198
|
fi
|
|
152
199
|
|
|
153
|
-
#
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
200
|
+
# Collect all arguments for the java command;
|
|
201
|
+
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
|
202
|
+
# shell script including quotes and variable substitutions, so put them in
|
|
203
|
+
# double quotes to make sure that they get re-expanded; and
|
|
204
|
+
# * put everything else in single quotes, so that it's not re-expanded.
|
|
205
|
+
|
|
206
|
+
set -- \
|
|
207
|
+
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
|
208
|
+
-classpath "$CLASSPATH" \
|
|
209
|
+
org.gradle.wrapper.GradleWrapperMain \
|
|
210
|
+
"$@"
|
|
211
|
+
|
|
212
|
+
# Stop when "xargs" is not available.
|
|
213
|
+
if ! command -v xargs >/dev/null 2>&1
|
|
214
|
+
then
|
|
215
|
+
die "xargs is not available"
|
|
216
|
+
fi
|
|
159
217
|
|
|
160
|
-
|
|
218
|
+
# Use "xargs" to parse quoted args.
|
|
219
|
+
#
|
|
220
|
+
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
221
|
+
#
|
|
222
|
+
# In Bash we could simply go:
|
|
223
|
+
#
|
|
224
|
+
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
|
225
|
+
# set -- "${ARGS[@]}" "$@"
|
|
226
|
+
#
|
|
227
|
+
# but POSIX shell has neither arrays nor command substitution, so instead we
|
|
228
|
+
# post-process each arg (as a line of input to sed) to backslash-escape any
|
|
229
|
+
# character that might be a shell metacharacter, then use eval to reverse
|
|
230
|
+
# that process (while maintaining the separation between arguments), and wrap
|
|
231
|
+
# the whole thing up as a single "set" statement.
|
|
232
|
+
#
|
|
233
|
+
# This will of course break if any of these variables contains a newline or
|
|
234
|
+
# an unmatched quote.
|
|
235
|
+
#
|
|
236
|
+
|
|
237
|
+
eval "set -- $(
|
|
238
|
+
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
|
239
|
+
xargs -n1 |
|
|
240
|
+
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
|
241
|
+
tr '\n' ' '
|
|
242
|
+
)" '"$@"'
|
|
243
|
+
|
|
244
|
+
exec "$JAVACMD" "$@"
|
package/android/gradlew.bat
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
@rem limitations under the License.
|
|
15
15
|
@rem
|
|
16
16
|
|
|
17
|
-
@if "%DEBUG%"
|
|
17
|
+
@if "%DEBUG%"=="" @echo off
|
|
18
18
|
@rem ##########################################################################
|
|
19
19
|
@rem
|
|
20
20
|
@rem Gradle startup script for Windows
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
if "%OS%"=="Windows_NT" setlocal
|
|
26
26
|
|
|
27
27
|
set DIRNAME=%~dp0
|
|
28
|
-
if "%DIRNAME%"
|
|
28
|
+
if "%DIRNAME%"=="" set DIRNAME=.
|
|
29
|
+
@rem This is normally unused
|
|
29
30
|
set APP_BASE_NAME=%~n0
|
|
30
31
|
set APP_HOME=%DIRNAME%
|
|
31
32
|
|
|
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|
|
40
41
|
|
|
41
42
|
set JAVA_EXE=java.exe
|
|
42
43
|
%JAVA_EXE% -version >NUL 2>&1
|
|
43
|
-
if
|
|
44
|
+
if %ERRORLEVEL% equ 0 goto execute
|
|
44
45
|
|
|
45
46
|
echo.
|
|
46
47
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
@@ -75,15 +76,17 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
|
75
76
|
|
|
76
77
|
:end
|
|
77
78
|
@rem End local scope for the variables with windows NT shell
|
|
78
|
-
if
|
|
79
|
+
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
79
80
|
|
|
80
81
|
:fail
|
|
81
82
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
82
83
|
rem the _cmd.exe /c_ return code!
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
set EXIT_CODE=%ERRORLEVEL%
|
|
85
|
+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
86
|
+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
87
|
+
exit /b %EXIT_CODE%
|
|
85
88
|
|
|
86
89
|
:mainEnd
|
|
87
90
|
if "%OS%"=="Windows_NT" endlocal
|
|
88
91
|
|
|
89
|
-
:omega
|
|
92
|
+
:omega
|
|
Binary file
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
package com.anyline.reactnative;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
|
|
5
|
+
import org.json.JSONObject;
|
|
6
|
+
|
|
7
|
+
import java.io.IOException;
|
|
8
|
+
|
|
9
|
+
import io.anyline.util.SoundUtil;
|
|
10
|
+
|
|
11
|
+
public class FeedbackConfig {
|
|
12
|
+
private SoundUtil soundUtil;
|
|
13
|
+
public ImageTextConfig wrongFormat = null;
|
|
14
|
+
public ImageTextConfig brightnessTooHigh = null;
|
|
15
|
+
public ImageTextConfig brightnessTooLow = null;
|
|
16
|
+
public ImageTextConfig distance = null;
|
|
17
|
+
public String sound = null;
|
|
18
|
+
|
|
19
|
+
public FeedbackConfig(Context context, JSONObject jsonObject) {
|
|
20
|
+
if (jsonObject.has("format")) {
|
|
21
|
+
wrongFormat = new ImageTextConfig(context, jsonObject.optJSONObject("format"));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (jsonObject.has("distance")) {
|
|
25
|
+
distance = new ImageTextConfig(context, jsonObject.optJSONObject("distance"));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (jsonObject.has("brightness")) {
|
|
29
|
+
JSONObject jsonBrightness = jsonObject.optJSONObject("brightness");
|
|
30
|
+
if (jsonBrightness.has("too_high")) {
|
|
31
|
+
brightnessTooHigh = new ImageTextConfig(context, jsonBrightness.optJSONObject("too_high"));
|
|
32
|
+
}
|
|
33
|
+
if (jsonBrightness.has("too_low")) {
|
|
34
|
+
brightnessTooLow = new ImageTextConfig(context, jsonBrightness.optJSONObject("too_low"));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (jsonObject.has("sound")) {
|
|
39
|
+
sound = jsonObject.optString("sound", "");
|
|
40
|
+
soundUtil = new SoundUtil(context);
|
|
41
|
+
try {
|
|
42
|
+
soundUtil.loadSoundFromAssets(sound);
|
|
43
|
+
} catch (IOException e) {
|
|
44
|
+
soundUtil = null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public void playBeepSound() {
|
|
51
|
+
if (sound != null) {
|
|
52
|
+
if (soundUtil != null) {
|
|
53
|
+
soundUtil.playSound(sound);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package com.anyline.reactnative;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.content.res.AssetManager;
|
|
5
|
+
import android.graphics.Bitmap;
|
|
6
|
+
import android.graphics.BitmapFactory;
|
|
7
|
+
import android.util.Log;
|
|
8
|
+
|
|
9
|
+
import org.json.JSONObject;
|
|
10
|
+
|
|
11
|
+
import java.io.IOException;
|
|
12
|
+
import java.io.InputStream;
|
|
13
|
+
|
|
14
|
+
public class ImageTextConfig {
|
|
15
|
+
public String text = null;
|
|
16
|
+
public boolean hasImage = false;
|
|
17
|
+
public int imageResId = 0;
|
|
18
|
+
|
|
19
|
+
public ImageTextConfig(Context context, JSONObject jsonObject) {
|
|
20
|
+
if (jsonObject.has("text")) {
|
|
21
|
+
text = jsonObject.optString("text", "");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (jsonObject.has("image")) {
|
|
25
|
+
imageResId = context.getResources().getIdentifier(jsonObject.optString("image", ""),
|
|
26
|
+
"drawable",
|
|
27
|
+
context.getPackageName());
|
|
28
|
+
hasImage = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
protected Bitmap getBitmapFromAsset(Context context, String filePath) {
|
|
33
|
+
AssetManager assetManager = context.getAssets();
|
|
34
|
+
|
|
35
|
+
InputStream inputStream;
|
|
36
|
+
Bitmap bitmap = null;
|
|
37
|
+
try {
|
|
38
|
+
inputStream = assetManager.open(filePath);
|
|
39
|
+
bitmap = BitmapFactory.decodeStream(inputStream);
|
|
40
|
+
inputStream.close();
|
|
41
|
+
} catch (IOException e) {
|
|
42
|
+
Log.e("ImageTextConfig", e.getMessage());
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return bitmap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package com.anyline.reactnative;
|
|
2
|
+
|
|
3
|
+
import org.json.JSONObject;
|
|
4
|
+
|
|
5
|
+
public class InstructionConfig {
|
|
6
|
+
public String text = null;
|
|
7
|
+
public String textColor = null;
|
|
8
|
+
public String backgroundColor = null;
|
|
9
|
+
|
|
10
|
+
public InstructionConfig(JSONObject jsonObject) {
|
|
11
|
+
text = jsonObject.optString("text", "");
|
|
12
|
+
if (jsonObject.has("textColor")) {
|
|
13
|
+
textColor = jsonObject.optString("textColor", "");
|
|
14
|
+
}
|
|
15
|
+
if (jsonObject.has("backgroundColor")) {
|
|
16
|
+
backgroundColor = jsonObject.optString("backgroundColor", "");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -6,9 +6,16 @@ import static com.anyline.reactnative.AnylineSDKPlugin.RESULT_ERROR;
|
|
|
6
6
|
|
|
7
7
|
import android.content.Intent;
|
|
8
8
|
import android.content.pm.ActivityInfo;
|
|
9
|
+
import android.graphics.Bitmap;
|
|
10
|
+
import android.graphics.Color;
|
|
11
|
+
import android.graphics.Rect;
|
|
9
12
|
import android.os.Bundle;
|
|
10
|
-
import android.
|
|
13
|
+
import android.os.Handler;
|
|
14
|
+
import android.os.Looper;
|
|
15
|
+
import android.util.Pair;
|
|
11
16
|
import android.view.View;
|
|
17
|
+
import android.view.Gravity;
|
|
18
|
+
import android.util.Log;
|
|
12
19
|
|
|
13
20
|
import androidx.annotation.NonNull;
|
|
14
21
|
import androidx.annotation.Nullable;
|
|
@@ -21,14 +28,21 @@ import org.json.JSONArray;
|
|
|
21
28
|
import org.json.JSONException;
|
|
22
29
|
import org.json.JSONObject;
|
|
23
30
|
|
|
31
|
+
import java.io.IOException;
|
|
32
|
+
import java.util.Timer;
|
|
33
|
+
import java.util.TimerTask;
|
|
34
|
+
|
|
24
35
|
import io.anyline2.ScanResult;
|
|
36
|
+
import io.anyline2.view.BrightnessHelper;
|
|
25
37
|
import io.anyline2.view.ScanView;
|
|
38
|
+
import io.anyline2.viewplugin.ScanViewPlugin;
|
|
26
39
|
import io.anyline2.viewplugin.ViewPluginBase;
|
|
27
40
|
|
|
28
41
|
public class ScanActivity extends AppCompatActivity {
|
|
29
42
|
|
|
30
43
|
private static final String KEY_DEFAULT_ORIENTATION_APPLIED = "default_orientation_applied";
|
|
31
44
|
|
|
45
|
+
private Handler handler = new Handler(Looper.getMainLooper());
|
|
32
46
|
private ActivityScanBinding binding;
|
|
33
47
|
private ScanView scanView;
|
|
34
48
|
|
|
@@ -36,6 +50,21 @@ public class ScanActivity extends AppCompatActivity {
|
|
|
36
50
|
private boolean defaultOrientationApplied;
|
|
37
51
|
private int orientation;
|
|
38
52
|
|
|
53
|
+
private InstructionConfig instructionConfig = null;
|
|
54
|
+
private ImageTextConfig imageCutoutConfig = null;
|
|
55
|
+
private FeedbackConfig feedbackConfig = null;
|
|
56
|
+
|
|
57
|
+
private long cleanUIFeedbackIntervalMills = 2000L;
|
|
58
|
+
private Timer cleanUIFeedbackTimer = null;
|
|
59
|
+
|
|
60
|
+
private static final String FEEDBACK_SCANINFO_LIGHTINGCONDITION = "$lightingCondition";
|
|
61
|
+
private static final String FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOODARK = "TOODARK";
|
|
62
|
+
private static final String FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOOBRIGHT = "TOOBRIGHT";
|
|
63
|
+
private static final int FEEDBACK_RUNSKIPPED_WRONGFORMAT = 5006;
|
|
64
|
+
private static final int FEEDBACK_RUNSKIPPED_WRONGDATE = 5027;
|
|
65
|
+
private static final int FEEDBACK_RUNSKIPPED_TOOCLOSE = 5023;
|
|
66
|
+
private static final int FEEDBACK_RUNSKIPPED_TOOFAR = 5024;
|
|
67
|
+
|
|
39
68
|
@Override
|
|
40
69
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
41
70
|
super.onCreate(savedInstanceState);
|
|
@@ -59,11 +88,47 @@ public class ScanActivity extends AppCompatActivity {
|
|
|
59
88
|
|
|
60
89
|
applyDefaultOrientation(configJSON);
|
|
61
90
|
setupChangeOrientationButton(configJSON);
|
|
91
|
+
setupCustomUIFeedback(configJSON);
|
|
62
92
|
|
|
63
93
|
scanView.init(configJSON);
|
|
64
94
|
|
|
65
95
|
ViewPluginBase viewPluginBase = scanView.getScanViewPlugin();
|
|
66
96
|
|
|
97
|
+
viewPluginBase.scanInfoReceived = jsonObject -> {
|
|
98
|
+
if (jsonObject.optString("name", "").equals(FEEDBACK_SCANINFO_LIGHTINGCONDITION)) {
|
|
99
|
+
String lightingConditionValue = jsonObject.optString("value", "");
|
|
100
|
+
if (feedbackConfig != null) {
|
|
101
|
+
if (lightingConditionValue.equalsIgnoreCase(FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOODARK)) {
|
|
102
|
+
if (feedbackConfig.brightnessTooLow != null) {
|
|
103
|
+
updateUIFeedback(feedbackConfig.brightnessTooLow);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else if (lightingConditionValue.equalsIgnoreCase(FEEDBACK_SCANINFO_LIGHTINGCONDITION_TOOBRIGHT)) {
|
|
107
|
+
if (feedbackConfig.brightnessTooHigh != null) {
|
|
108
|
+
updateUIFeedback(feedbackConfig.brightnessTooHigh);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
viewPluginBase.runSkippedReceived = jsonObject -> {
|
|
116
|
+
if (feedbackConfig != null) {
|
|
117
|
+
if (jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_WRONGFORMAT
|
|
118
|
+
|| jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_WRONGDATE) {
|
|
119
|
+
if (feedbackConfig.wrongFormat != null) {
|
|
120
|
+
updateUIFeedback(feedbackConfig.wrongFormat);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_TOOCLOSE
|
|
124
|
+
|| jsonObject.optInt("code", 0) == FEEDBACK_RUNSKIPPED_TOOFAR) {
|
|
125
|
+
if (feedbackConfig.distance != null) {
|
|
126
|
+
updateUIFeedback(feedbackConfig.distance);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
67
132
|
viewPluginBase.resultReceived = scanResult -> {
|
|
68
133
|
setResult(AnylineSDKPlugin.RESULT_OK);
|
|
69
134
|
JSONObject resultObject = getResultWithImagePath(scanResult);
|
|
@@ -157,6 +222,120 @@ public class ScanActivity extends AppCompatActivity {
|
|
|
157
222
|
}
|
|
158
223
|
}
|
|
159
224
|
|
|
225
|
+
private void setupCustomUIFeedback(JSONObject configJSON) {
|
|
226
|
+
JSONObject optionsJsonObject = configJSON.optJSONObject("options");
|
|
227
|
+
if (optionsJsonObject != null) {
|
|
228
|
+
try {
|
|
229
|
+
if (optionsJsonObject.has("instruction")) {
|
|
230
|
+
instructionConfig = new InstructionConfig(optionsJsonObject.getJSONObject("instruction"));
|
|
231
|
+
}
|
|
232
|
+
if (optionsJsonObject.has("imageCutout")) {
|
|
233
|
+
imageCutoutConfig = new ImageTextConfig(this, optionsJsonObject.getJSONObject("imageCutout"));
|
|
234
|
+
}
|
|
235
|
+
if (optionsJsonObject.has("feedback")) {
|
|
236
|
+
feedbackConfig = new FeedbackConfig(this, optionsJsonObject.getJSONObject("feedback"));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
catch (JSONException e) {
|
|
240
|
+
finishWithError("Error setting up UI Feedback: " + e.getMessage());
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (instructionConfig != null) {
|
|
245
|
+
if (instructionConfig.text != null) {
|
|
246
|
+
binding.textviewInstruction.setText(instructionConfig.text);
|
|
247
|
+
}
|
|
248
|
+
if (instructionConfig.textColor != null) {
|
|
249
|
+
binding.textviewInstruction.setTextColor(Color.parseColor("#" + instructionConfig.textColor));
|
|
250
|
+
}
|
|
251
|
+
if (instructionConfig.backgroundColor != null) {
|
|
252
|
+
binding.textviewInstruction.setBackgroundColor(Color.parseColor("#" + instructionConfig.backgroundColor));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (imageCutoutConfig != null) {
|
|
257
|
+
if (imageCutoutConfig.hasImage) {
|
|
258
|
+
binding.imageviewCutoutOverlay.setImageResource(imageCutoutConfig.imageResId);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
scanView.onCutoutChanged = cutouts -> {
|
|
265
|
+
Pair<ScanViewPlugin, android.graphics.Rect> firstCutout = cutouts.get(0);
|
|
266
|
+
|
|
267
|
+
ScanViewPlugin scanViewPlugin = firstCutout.first;
|
|
268
|
+
if (scanViewPlugin != null) {
|
|
269
|
+
Rect rect = firstCutout.second;
|
|
270
|
+
if (rect != null) {
|
|
271
|
+
if (instructionConfig != null) {
|
|
272
|
+
CoordinatorLayout.LayoutParams instructionLayoutParams =
|
|
273
|
+
new CoordinatorLayout.LayoutParams(rect.width(), rect.top);
|
|
274
|
+
instructionLayoutParams.setMargins(rect.left, 0, rect.right, rect.top);
|
|
275
|
+
binding.layoutInstruction.setVisibility(View.VISIBLE);
|
|
276
|
+
binding.layoutInstruction.setLayoutParams(instructionLayoutParams);
|
|
277
|
+
binding.layoutInstruction.requestLayout();
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (imageCutoutConfig != null) {
|
|
281
|
+
CoordinatorLayout.LayoutParams imageCutoutLayoutParams =
|
|
282
|
+
new CoordinatorLayout.LayoutParams(rect.width(), rect.height());
|
|
283
|
+
imageCutoutLayoutParams.setMargins(rect.left, rect.top, rect.right, rect.bottom);
|
|
284
|
+
binding.imageviewCutoutOverlay.setVisibility(View.VISIBLE);
|
|
285
|
+
binding.imageviewCutoutOverlay.setLayoutParams(imageCutoutLayoutParams);
|
|
286
|
+
binding.imageviewCutoutOverlay.requestLayout();
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (feedbackConfig != null) {
|
|
290
|
+
CoordinatorLayout.LayoutParams feedbackLayoutParams =
|
|
291
|
+
new CoordinatorLayout.LayoutParams(rect.width(), scanView.getHeight());
|
|
292
|
+
feedbackLayoutParams.setMargins(rect.left, rect.bottom, rect.right, scanView.getBottom());
|
|
293
|
+
binding.layoutBrightDistanceFeedback.setVisibility(View.VISIBLE);
|
|
294
|
+
binding.layoutBrightDistanceFeedback.setLayoutParams(feedbackLayoutParams);
|
|
295
|
+
binding.layoutBrightDistanceFeedback.requestLayout();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
private void updateUIFeedback(ImageTextConfig imageTextFeedback) {
|
|
303
|
+
if (imageTextFeedback.text != null) {
|
|
304
|
+
if (binding.textviewBrightDistanceFeedback.getText().equals(imageTextFeedback.text)) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
handler.post(() -> {
|
|
310
|
+
if (imageTextFeedback.text != null) {
|
|
311
|
+
binding.textviewBrightDistanceFeedback.setText(imageTextFeedback.text);
|
|
312
|
+
}
|
|
313
|
+
if (imageTextFeedback.hasImage) {
|
|
314
|
+
binding.imageviewBrightDistanceFeedback.setImageResource(imageTextFeedback.imageResId);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (feedbackConfig != null) {
|
|
318
|
+
if (feedbackConfig.sound != null) {
|
|
319
|
+
feedbackConfig.playBeepSound();
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (cleanUIFeedbackTimer != null) {
|
|
324
|
+
cleanUIFeedbackTimer.cancel();
|
|
325
|
+
}
|
|
326
|
+
cleanUIFeedbackTimer = new Timer();
|
|
327
|
+
cleanUIFeedbackTimer.schedule(new TimerTask() {
|
|
328
|
+
@Override
|
|
329
|
+
public void run() {
|
|
330
|
+
handler.post(() -> {
|
|
331
|
+
binding.textviewBrightDistanceFeedback.setText("");
|
|
332
|
+
binding.imageviewBrightDistanceFeedback.setImageBitmap(null);
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}, cleanUIFeedbackIntervalMills);
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
|
|
160
339
|
@NonNull
|
|
161
340
|
private JSONObject getResultWithImagePath(ScanResult scanResult) {
|
|
162
341
|
JSONObject resultObject = scanResult.getResult();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -18,10 +18,61 @@
|
|
|
18
18
|
android:padding="40px">
|
|
19
19
|
<ImageView
|
|
20
20
|
android:id="@+id/imageview_change_orientation"
|
|
21
|
-
android:layout_width="
|
|
22
|
-
android:layout_height="
|
|
21
|
+
android:layout_width="56dp"
|
|
22
|
+
android:layout_height="56dp"
|
|
23
23
|
android:scaleType="fitStart"
|
|
24
24
|
android:background="@drawable/rotate_screen_background"
|
|
25
25
|
android:src="@drawable/rotate_screen_white" />
|
|
26
26
|
</LinearLayout>
|
|
27
|
+
|
|
28
|
+
<LinearLayout
|
|
29
|
+
android:id="@+id/layout_instruction"
|
|
30
|
+
android:layout_width="match_parent"
|
|
31
|
+
android:layout_height="wrap_content"
|
|
32
|
+
android:visibility="gone"
|
|
33
|
+
android:layout_gravity="bottom"
|
|
34
|
+
android:gravity="bottom"
|
|
35
|
+
android:layout_marginVertical="30dp"
|
|
36
|
+
android:paddingBottom="30dp"
|
|
37
|
+
android:orientation="vertical">
|
|
38
|
+
<TextView
|
|
39
|
+
android:id="@+id/textview_instruction"
|
|
40
|
+
android:layout_width="match_parent"
|
|
41
|
+
android:layout_height="wrap_content"
|
|
42
|
+
android:gravity="bottom|center_horizontal"
|
|
43
|
+
android:padding="10dp"
|
|
44
|
+
android:text=""
|
|
45
|
+
android:textColor="@color/white"
|
|
46
|
+
android:textSize="14sp" />
|
|
47
|
+
</LinearLayout>
|
|
48
|
+
|
|
49
|
+
<LinearLayout
|
|
50
|
+
android:id="@+id/layout_bright_distance_feedback"
|
|
51
|
+
android:layout_width="match_parent"
|
|
52
|
+
android:layout_height="wrap_content"
|
|
53
|
+
android:visibility="gone"
|
|
54
|
+
android:layout_centerHorizontal="true"
|
|
55
|
+
android:gravity="center_horizontal"
|
|
56
|
+
android:paddingTop="100px"
|
|
57
|
+
android:orientation="vertical">
|
|
58
|
+
<ImageView
|
|
59
|
+
android:id="@+id/imageview_bright_distance_feedback"
|
|
60
|
+
android:layout_width="50dp"
|
|
61
|
+
android:layout_height="50dp"
|
|
62
|
+
android:layout_marginVertical="5dp" />
|
|
63
|
+
<TextView
|
|
64
|
+
android:id="@+id/textview_bright_distance_feedback"
|
|
65
|
+
android:layout_width="wrap_content"
|
|
66
|
+
android:layout_height="wrap_content"
|
|
67
|
+
android:text=""
|
|
68
|
+
android:textColor="@color/white"
|
|
69
|
+
android:textSize="14sp" />
|
|
70
|
+
</LinearLayout>
|
|
71
|
+
|
|
72
|
+
<ImageView
|
|
73
|
+
android:id="@+id/imageview_cutout_overlay"
|
|
74
|
+
android:layout_width="wrap_content"
|
|
75
|
+
android:layout_height="wrap_content"
|
|
76
|
+
android:visibility="gone"
|
|
77
|
+
android:scaleType="fitStart" />
|
|
27
78
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@@ -57,7 +57,9 @@ NSString * const ENABLE_NATIVE_BARCODE = @"nativeBarcodeScanningFormats";
|
|
|
57
57
|
_labelXPositionOffset = 0.0f;
|
|
58
58
|
_labelYPositionOffset = 0.0f;
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
// (ACO) 20230313
|
|
61
|
+
// nativeBarcodeFormats = [] would be interpreted as ['ALL']
|
|
62
|
+
_nativeBarcodeFormats = nil;
|
|
61
63
|
|
|
62
64
|
if ([dictionary valueForKey:ENABLE_NATIVE_BARCODE]) {
|
|
63
65
|
NSArray<NSString *> *formats = [dictionary valueForKey:ENABLE_NATIVE_BARCODE];
|
|
@@ -21,11 +21,6 @@ API_AVAILABLE(ios(13.0))
|
|
|
21
21
|
// the result from NFC scanning is retained while NFC reading is initiated, and the results aggregated later
|
|
22
22
|
@property (nonatomic, strong) NSMutableDictionary *resultDict;
|
|
23
23
|
|
|
24
|
-
// TODO: make sure the following use the `options` group in the uiConfig
|
|
25
|
-
// BOOL showingLabel
|
|
26
|
-
// UILabel scannedLabel
|
|
27
|
-
// ALRoundedView
|
|
28
|
-
// Segment
|
|
29
24
|
@property (nonatomic, strong) ALJSONUIConfiguration *uiConfig;
|
|
30
25
|
|
|
31
26
|
@property (nonatomic, strong) UIView *hintView;
|
|
@@ -48,9 +43,6 @@ API_AVAILABLE(ios(13.0))
|
|
|
48
43
|
|
|
49
44
|
@property (nonatomic, strong) NSMutableArray<NSDictionary *> *detectedBarcodes;
|
|
50
45
|
|
|
51
|
-
// not used
|
|
52
|
-
@property (nonatomic, strong) NSString *cropAndTransformErrorMessage;
|
|
53
|
-
|
|
54
46
|
// JPEG compression quality 0-100
|
|
55
47
|
@property (nonatomic, assign) NSUInteger quality;
|
|
56
48
|
|
|
@@ -71,7 +63,6 @@ API_AVAILABLE(ios(13.0))
|
|
|
71
63
|
_uiConfig = uiConfig;
|
|
72
64
|
|
|
73
65
|
self.quality = 90;
|
|
74
|
-
self.cropAndTransformErrorMessage = @"";
|
|
75
66
|
}
|
|
76
67
|
return self;
|
|
77
68
|
}
|
|
@@ -245,7 +236,6 @@ API_AVAILABLE(ios(13.0))
|
|
|
245
236
|
}
|
|
246
237
|
|
|
247
238
|
NSObject<ALScanViewPluginBase> *scanViewPluginBase = self.scanView.scanViewPlugin;
|
|
248
|
-
// TODO: handle this for composites: cancelOnResult = true? dismiss
|
|
249
239
|
if ([scanViewPluginBase isKindOfClass:ALScanViewPlugin.class]) {
|
|
250
240
|
ALScanViewPlugin *scanViewPlugin = (ALScanViewPlugin *)scanViewPluginBase;
|
|
251
241
|
BOOL cancelOnResult = scanViewPlugin.scanPlugin.scanPluginConfig.cancelOnResult;
|
package/ios/ALPluginHelper.m
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#import <objc/runtime.h>
|
|
5
5
|
|
|
6
6
|
// Predefined domain for errors from most AppKit and Foundation APIs.
|
|
7
|
-
NSErrorDomain const
|
|
7
|
+
NSErrorDomain const ALDefaultDomain = @"ALDefaultErrorDomain";
|
|
8
8
|
|
|
9
9
|
@implementation ALPluginHelper
|
|
10
10
|
|
|
@@ -51,16 +51,10 @@ NSErrorDomain const ALFlutterDomain = @"ALFlutterDomain";
|
|
|
51
51
|
uiConfiguration:jsonUIConf
|
|
52
52
|
finished:callback];
|
|
53
53
|
|
|
54
|
-
// TODO: should remove these extras
|
|
55
54
|
if ([pluginConf valueForKey:@"quality"]){
|
|
56
55
|
pluginScanViewController.quality = [[pluginConf valueForKey:@"quality"] integerValue];
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
if ([pluginConf valueForKey:@"cropAndTransformErrorMessage"]) {
|
|
60
|
-
NSString *str = [pluginConf objectForKey:@"cropAndTransformErrorMessage"];
|
|
61
|
-
pluginScanViewController.cropAndTransformErrorMessage = str;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
58
|
if (pluginScanViewController) {
|
|
65
59
|
[pluginScanViewController setModalPresentationStyle:UIModalPresentationFullScreen];
|
|
66
60
|
[[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:pluginScanViewController
|
|
@@ -264,21 +258,6 @@ NSErrorDomain const ALFlutterDomain = @"ALFlutterDomain";
|
|
|
264
258
|
}
|
|
265
259
|
|
|
266
260
|
#pragma mark - Date Parsing Utils
|
|
267
|
-
//
|
|
268
|
-
//+ (NSString *)stringForDate:(NSDate *)date {
|
|
269
|
-
// if (!date) {
|
|
270
|
-
// return nil;
|
|
271
|
-
// }
|
|
272
|
-
//
|
|
273
|
-
// NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
|
274
|
-
// [dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC+0:00"]];
|
|
275
|
-
// [dateFormatter setDateFormat:@"EEE MMM d hh:mm:ss ZZZZ yyyy"];
|
|
276
|
-
//
|
|
277
|
-
// //Date will be formatted to string - e.g.: "Fri Jan 11 12:00:00 GMT+0:00 1980"
|
|
278
|
-
// NSString *dateString = [dateFormatter stringFromDate:date];
|
|
279
|
-
//
|
|
280
|
-
// return dateString;
|
|
281
|
-
//}
|
|
282
261
|
|
|
283
262
|
// MARK: Utilities
|
|
284
263
|
|
|
@@ -321,7 +300,7 @@ NSErrorDomain const ALFlutterDomain = @"ALFlutterDomain";
|
|
|
321
300
|
}
|
|
322
301
|
|
|
323
302
|
+ (NSError *)errorWithMessage:(NSString *)message {
|
|
324
|
-
return [NSError errorWithDomain:
|
|
303
|
+
return [NSError errorWithDomain:ALDefaultDomain code:1000 userInfo:@{ NSLocalizedDescriptionKey: message }];
|
|
325
304
|
}
|
|
326
305
|
|
|
327
306
|
// MARK: - Date Utils
|
|
@@ -373,5 +352,12 @@ NSErrorDomain const ALFlutterDomain = @"ALFlutterDomain";
|
|
|
373
352
|
return nil;
|
|
374
353
|
}
|
|
375
354
|
|
|
355
|
+
// MARK: - Miscellaneous
|
|
356
|
+
|
|
357
|
+
// actual implementation are in the view controllers
|
|
358
|
+
- (void)segmentChange:(id)segment {}
|
|
359
|
+
|
|
360
|
+
- (void)doneButtonPressed:(id)doneButton {}
|
|
361
|
+
|
|
376
362
|
|
|
377
363
|
@end
|
|
@@ -5,8 +5,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
5
5
|
|
|
6
6
|
@interface ALPluginScanViewController : UIViewController
|
|
7
7
|
|
|
8
|
-
@property (nonatomic, strong) NSString *cropAndTransformErrorMessage;
|
|
9
|
-
|
|
10
8
|
@property (nonatomic, assign) NSUInteger quality;
|
|
11
9
|
|
|
12
10
|
- (instancetype)initWithLicensekey:(NSString *)licenseKey
|
package/ios/AnylineReact.podspec
CHANGED
|
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
s.source = { :git => "https://github.com/Anyline/anyline-ocr-react-native-module.git", :tag => "#{s.version}" }
|
|
20
20
|
|
|
21
21
|
s.source_files = "*.{h,m}"
|
|
22
|
-
s.dependency "Anyline", "~>
|
|
22
|
+
s.dependency "Anyline", "~> 44.1.0"
|
|
23
23
|
s.dependency "React"
|
|
24
24
|
|
|
25
|
-
end
|
|
25
|
+
end
|
package/ios/AnylineSDKPlugin.m
CHANGED
|
@@ -66,8 +66,7 @@ RCT_EXPORT_METHOD(getSDKVersion:(RCTPromiseResolveBlock)resolve rejecter:(RCTPro
|
|
|
66
66
|
resolve(AnylineSDK.versionNumber);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
-(void)initView:(NSString *)scanMode {
|
|
69
|
+
- (void)initView:(NSString *)scanMode {
|
|
71
70
|
NSData *data = [self.config dataUsingEncoding:NSUTF8StringEncoding];
|
|
72
71
|
if(!data) {
|
|
73
72
|
[NSException raise:@"Config could not be loaded from disk" format:@"Config could not be loaded from disk"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "anyline-ocr-react-native-module@^
|
|
3
|
-
"_id": "anyline-ocr-react-native-module@^
|
|
2
|
+
"_from": "anyline-ocr-react-native-module@^44.1.0",
|
|
3
|
+
"_id": "anyline-ocr-react-native-module@^44.1.0",
|
|
4
4
|
"_inBundle": false,
|
|
5
5
|
"_integrity": "sha512-BGi9zNkSsoxXywDBIqzgBRvKUBniQOJHDKBrozZubKthZNRBAj8Ry5tW0Me0yLXt/fauME//hbC0wsenfPJZqw==",
|
|
6
6
|
"_location": "/anyline-ocr-react-native-module",
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "range",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "anyline-ocr-react-native-module@^
|
|
11
|
+
"raw": "anyline-ocr-react-native-module@^44.1.0",
|
|
12
12
|
"name": "anyline-ocr-react-native-module",
|
|
13
13
|
"escapedName": "anyline-ocr-react-native-module",
|
|
14
|
-
"rawSpec": "^
|
|
14
|
+
"rawSpec": "^44.1.0",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^
|
|
16
|
+
"fetchSpec": "^44.1.0"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/anyline-ocr-react-native-module/-/anyline-ocr-react-native-module-44.1.0.tgz",
|
|
22
22
|
"_shasum": "bacbcd260cc662244f59393ed81a6edba009b52c",
|
|
23
|
-
"_spec": "anyline-ocr-react-native-module@^
|
|
23
|
+
"_spec": "anyline-ocr-react-native-module@^44.1.0",
|
|
24
24
|
"_where": "/Users/amiransari/Projects/anyline-ocr-react-native-module1/example/RNExampleApp",
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/Anyline/anyline-ocr-react-native-module/issues"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"type": "git",
|
|
48
48
|
"url": "git+https://github.com/Anyline/anyline-ocr-react-native-module.git"
|
|
49
49
|
},
|
|
50
|
-
"version": "
|
|
50
|
+
"version": "44.1.0"
|
|
51
51
|
}
|