react-native-okaycam 1.2.5 → 1.2.6

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.
@@ -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.3@aar') {
42
+ implementation('com.innov8tif.okaycam:OkayCam:1.2.4@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) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-okaycam",
3
3
  "title": "React Native OkayCam",
4
- "version": "1.2.5",
4
+ "version": "1.2.6",
5
5
  "description": "React-Native version of OkayCam",
6
6
  "main": "index.ts",
7
7
  "files": [