react-native-okaycam 1.2.5 → 1.2.7
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/README.md +2 -2
- package/android/.gradle/6.8/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/innov8tif/RNOkayCam/RNOkayCamModule.java +3 -9
- package/index.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -104,8 +104,7 @@ const license = Platform.select({
|
|
|
104
104
|
|instruction <sup>**New**</sup> |title|Instruction's title on camera caputre screen|""(empty string)|
|
|
105
105
|
|instruction <sup>**New**</sup> |refImage1|Instruction's reference image 1|null|
|
|
106
106
|
|instruction <sup>**New**</sup> |refImage2|Instruction's reference image 2|null|
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
|-|showPreviewInstruction|Show or hide preview instruction for captured photos|false|
|
|
109
108
|
|
|
110
109
|
## Usage
|
|
111
110
|
```
|
|
@@ -179,6 +178,7 @@ captureDocument(
|
|
|
179
178
|
img: require('./images/ref.png'),
|
|
180
179
|
},
|
|
181
180
|
},
|
|
181
|
+
showPreviewInstruction: false,
|
|
182
182
|
}
|
|
183
183
|
)
|
|
184
184
|
.then(result => {
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Fri Jan 05 16:34:25 BDT 2024
|
|
2
2
|
gradle.version=6.8
|
package/android/build.gradle
CHANGED
|
@@ -39,7 +39,7 @@ repositories {
|
|
|
39
39
|
|
|
40
40
|
dependencies {
|
|
41
41
|
implementation 'com.facebook.react:react-native:+'
|
|
42
|
-
implementation('com.innov8tif.okaycam:OkayCam:1.2.
|
|
42
|
+
implementation('com.innov8tif.okaycam:OkayCam:1.2.5@aar') {
|
|
43
43
|
transitive = true
|
|
44
44
|
}
|
|
45
45
|
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
|
|
@@ -80,11 +80,10 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
80
80
|
ReadableMap preview = userConfig.getMap("preview");
|
|
81
81
|
ReadableMap instruction = userConfig.getMap("instruction");
|
|
82
82
|
|
|
83
|
-
|
|
84
83
|
OkayCamConfig okayCamConfig = OkayCamConfig.init(this.getCurrentActivity());
|
|
85
84
|
|
|
86
85
|
okayCamConfig.setShowOverlay(userConfig.getBoolean("showOverlay"));
|
|
87
|
-
|
|
86
|
+
okayCamConfig.setShowPreviewInstruction(userConfig.getBoolean("showPreviewInstruction"));
|
|
88
87
|
okayCamConfig.setTorchBtnEnabled(userConfig.getBoolean("torchBtnEnabled"));
|
|
89
88
|
okayCamConfig.setCrop(userConfig.getBoolean("crop"));
|
|
90
89
|
|
|
@@ -99,6 +98,7 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
99
98
|
Color.parseColor(topLabel.getString("color")),
|
|
100
99
|
topLabel.getInt("size")
|
|
101
100
|
));
|
|
101
|
+
|
|
102
102
|
okayCamConfig.setBottomLabel(new OkayCamLabelConfig(
|
|
103
103
|
bottomLabel.getString("text"),
|
|
104
104
|
Color.parseColor(bottomLabel.getString("color")),
|
|
@@ -146,7 +146,6 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
146
146
|
if (success) {
|
|
147
147
|
JSONObject results = new JSONObject();
|
|
148
148
|
try {
|
|
149
|
-
|
|
150
149
|
results.put("fullDocumentImage", convertImgToBase64(base64, images.get(0)));
|
|
151
150
|
|
|
152
151
|
if (images.size() > 1) {
|
|
@@ -163,7 +162,6 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
163
162
|
|
|
164
163
|
promise.resolve(results.toString());
|
|
165
164
|
} catch (JSONException e) {
|
|
166
|
-
// TODO Auto-generated catch block
|
|
167
165
|
e.printStackTrace();
|
|
168
166
|
promise.reject(this.getError(e.getMessage()));
|
|
169
167
|
}
|
|
@@ -201,8 +199,6 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
201
199
|
}
|
|
202
200
|
|
|
203
201
|
private String getImageFromJs(String refImage, OkayCamFrameConfig frameConfig, String fileName) {
|
|
204
|
-
|
|
205
|
-
|
|
206
202
|
Size size = frameConfig.getSize();
|
|
207
203
|
int frameWidth = size.getWidth();
|
|
208
204
|
int frameHeight = size.getHeight();
|
|
@@ -210,7 +206,6 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
210
206
|
Bitmap contentBmp = null;
|
|
211
207
|
try {
|
|
212
208
|
if (refImage != null) {
|
|
213
|
-
|
|
214
209
|
// In debug, the image is returned as URL
|
|
215
210
|
if (BuildConfig.DEBUG) {
|
|
216
211
|
InputStream inputStream = new URL(refImage).openStream();
|
|
@@ -288,7 +283,6 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
288
283
|
Bitmap contentBmp = null;
|
|
289
284
|
try {
|
|
290
285
|
if (refImage != null) {
|
|
291
|
-
|
|
292
286
|
// In debug, the image is returned as URL
|
|
293
287
|
if (BuildConfig.DEBUG) {
|
|
294
288
|
InputStream inputStream = new URL(refImage).openStream();
|
|
@@ -559,4 +553,4 @@ public class RNOkayCamModule extends ReactContextBaseJavaModule {
|
|
|
559
553
|
}
|
|
560
554
|
return new Exception(errorString);
|
|
561
555
|
}
|
|
562
|
-
}
|
|
556
|
+
}
|
package/index.ts
CHANGED
|
@@ -166,6 +166,7 @@ export const captureDocument = (
|
|
|
166
166
|
imageQuality = 1.0,
|
|
167
167
|
preview = defaultPreview,
|
|
168
168
|
instruction = defaultInstruction,
|
|
169
|
+
showPreviewInstruction = false,
|
|
169
170
|
}
|
|
170
171
|
) => {
|
|
171
172
|
if (frame.size == undefined) {
|
|
@@ -219,6 +220,7 @@ export const captureDocument = (
|
|
|
219
220
|
imageQuality: imageQuality,
|
|
220
221
|
preview: resultedPreview,
|
|
221
222
|
instruction: formatInstruction(instruction),
|
|
223
|
+
showPreviewInstruction: showPreviewInstruction,
|
|
222
224
|
},
|
|
223
225
|
})
|
|
224
226
|
.then((result) => {
|