dynamsoft-capture-vision-react-native 1.1.1 → 1.1.4-beta09052010
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 +278 -278
- package/android/build.gradle +54 -54
- package/android/src/main/AndroidManifest.xml +5 -5
- package/android/src/main/java/com/dynamsoft/reactlibrary/Constants.java +23 -23
- package/android/src/main/java/com/dynamsoft/reactlibrary/RNDCECameraView.java +19 -2
- package/android/src/main/java/com/dynamsoft/reactlibrary/RNDCECameraViewManager.java +18 -6
- package/android/src/main/java/com/dynamsoft/reactlibrary/RNDynamsoftBarcodeReaderModule.java +284 -282
- package/android/src/main/java/com/dynamsoft/reactlibrary/RNDynamsoftCaptrueVisionPackage.java +35 -38
- package/dynamsoft-capture-vision-react-native.podspec +22 -22
- package/ios/RNDynamsoftCaptureVision/DYSCameraView.m +8 -4
- package/js/BarcodeResult.d.ts +25 -25
- package/js/BarcodeResult.js +2 -2
- package/js/BasicStructures.d.ts +20 -20
- package/js/BasicStructures.js +2 -2
- package/js/CameraSettings.d.ts +11 -11
- package/js/CameraSettings.js +8 -8
- package/js/DynamsoftBarcodeReader.js +75 -75
- package/package.json +38 -38
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
package="com.dynamsoft.reactlibrary">
|
|
4
|
-
|
|
5
|
-
</manifest>
|
|
1
|
+
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
package="com.dynamsoft.reactlibrary">
|
|
4
|
+
|
|
5
|
+
</manifest>
|
|
6
6
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2016 The Android Open Source Project
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
package com.dynamsoft.reactlibrary;
|
|
17
|
-
|
|
18
|
-
public interface Constants {
|
|
19
|
-
int TORCH_OFF = 0;
|
|
20
|
-
int TORCH_ON = 1;
|
|
21
|
-
// int FLASH_TORCH = 2;
|
|
22
|
-
// int FLASH_AUTO = 3;
|
|
23
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2016 The Android Open Source Project
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
package com.dynamsoft.reactlibrary;
|
|
17
|
+
|
|
18
|
+
public interface Constants {
|
|
19
|
+
int TORCH_OFF = 0;
|
|
20
|
+
int TORCH_ON = 1;
|
|
21
|
+
// int FLASH_TORCH = 2;
|
|
22
|
+
// int FLASH_AUTO = 3;
|
|
23
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
package com.dynamsoft.reactlibrary;
|
|
2
2
|
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
3
6
|
import com.dynamsoft.dce.CameraEnhancer;
|
|
4
7
|
import com.dynamsoft.dce.CameraEnhancerException;
|
|
5
8
|
import com.dynamsoft.dce.DCECameraView;
|
|
@@ -10,12 +13,18 @@ import com.facebook.react.uimanager.ThemedReactContext;
|
|
|
10
13
|
public class RNDCECameraView extends DCECameraView implements LifecycleEventListener {
|
|
11
14
|
|
|
12
15
|
CameraEnhancer mCamera;
|
|
16
|
+
ReactApplicationContext mAppContext;
|
|
17
|
+
RNDynamsoftBarcodeReaderModule mDbrModule;
|
|
13
18
|
|
|
14
|
-
public RNDCECameraView(ThemedReactContext context, ReactApplicationContext appContext, CameraEnhancer cameraEnhancer) {
|
|
19
|
+
public RNDCECameraView(ThemedReactContext context, ReactApplicationContext appContext, @Nullable CameraEnhancer cameraEnhancer, @NonNull RNDynamsoftBarcodeReaderModule dbrModule) {
|
|
15
20
|
super(context);
|
|
16
21
|
context.addLifecycleEventListener(this);
|
|
22
|
+
mAppContext = appContext;
|
|
23
|
+
mDbrModule = dbrModule;
|
|
17
24
|
mCamera = cameraEnhancer;
|
|
18
|
-
mCamera
|
|
25
|
+
if(mCamera != null) {
|
|
26
|
+
mCamera.setCameraView(this);
|
|
27
|
+
}
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
@Override
|
|
@@ -40,6 +49,14 @@ public class RNDCECameraView extends DCECameraView implements LifecycleEventList
|
|
|
40
49
|
|
|
41
50
|
@Override
|
|
42
51
|
public void onHostResume() {
|
|
52
|
+
if(mCamera == null) {
|
|
53
|
+
if(mAppContext.getCurrentActivity() != null) {
|
|
54
|
+
mCamera = new CameraEnhancer(mAppContext.getCurrentActivity());
|
|
55
|
+
mCamera.setCameraView(this);
|
|
56
|
+
mDbrModule.mIsCameraAttached = false;
|
|
57
|
+
mDbrModule.mReader.setCameraEnhancer(mCamera);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
43
60
|
if(mCamera!=null){
|
|
44
61
|
try {
|
|
45
62
|
mCamera.open();
|
|
@@ -7,6 +7,8 @@ import android.graphics.drawable.BitmapDrawable;
|
|
|
7
7
|
import android.graphics.drawable.Drawable;
|
|
8
8
|
import android.util.Base64;
|
|
9
9
|
|
|
10
|
+
import androidx.annotation.NonNull;
|
|
11
|
+
|
|
10
12
|
import com.dynamsoft.dce.CameraEnhancer;
|
|
11
13
|
import com.dynamsoft.dce.CameraEnhancerException;
|
|
12
14
|
import com.dynamsoft.dce.RegionDefinition;
|
|
@@ -33,12 +35,16 @@ public class RNDCECameraViewManager extends ViewGroupManager<RNDCECameraView> {
|
|
|
33
35
|
CameraEnhancer mCamera;
|
|
34
36
|
RNDynamsoftBarcodeReaderModule mDbrModule;
|
|
35
37
|
|
|
36
|
-
public RNDCECameraViewManager(ReactApplicationContext reactContext, RNDynamsoftBarcodeReaderModule dbrModule) {
|
|
38
|
+
public RNDCECameraViewManager(ReactApplicationContext reactContext, @NonNull RNDynamsoftBarcodeReaderModule dbrModule) {
|
|
37
39
|
mReactApplicationContext = reactContext;
|
|
38
40
|
mDbrModule = dbrModule;
|
|
39
|
-
if (
|
|
40
|
-
mCamera = new CameraEnhancer(
|
|
41
|
+
if (reactContext.getCurrentActivity() != null) {
|
|
42
|
+
mCamera = new CameraEnhancer(reactContext.getCurrentActivity());
|
|
41
43
|
dbrModule.mCamera = mCamera;
|
|
44
|
+
if(dbrModule.mReader != null && !dbrModule.mIsCameraAttached) {
|
|
45
|
+
dbrModule.mIsCameraAttached = true;
|
|
46
|
+
dbrModule.mReader.setCameraEnhancer(mCamera);
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
|
|
@@ -52,10 +58,16 @@ public class RNDCECameraViewManager extends ViewGroupManager<RNDCECameraView> {
|
|
|
52
58
|
@Override
|
|
53
59
|
protected RNDCECameraView createViewInstance(ThemedReactContext reactContext) {
|
|
54
60
|
if (mCamera == null) {
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
if (reactContext.getCurrentActivity() != null) {
|
|
62
|
+
mCamera = new CameraEnhancer(reactContext.getCurrentActivity());
|
|
63
|
+
mDbrModule.mCamera = mCamera;
|
|
64
|
+
if(mDbrModule.mReader != null && !mDbrModule.mIsCameraAttached) {
|
|
65
|
+
mDbrModule.mIsCameraAttached = true;
|
|
66
|
+
mDbrModule.mReader.setCameraEnhancer(mCamera);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
57
69
|
}
|
|
58
|
-
return new RNDCECameraView(reactContext, mReactApplicationContext, mCamera);
|
|
70
|
+
return new RNDCECameraView(reactContext, mReactApplicationContext, mCamera, mDbrModule);
|
|
59
71
|
}
|
|
60
72
|
|
|
61
73
|
@ReactProp(name = "overlayVisible")
|