scandit-react-native-datacapture-core 6.28.1 → 6.28.2
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 +1 -1
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ScanditDataCaptureCoreModule.kt +11 -14
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ScanditDataCaptureCorePackage.kt +29 -24
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ui/DataCaptureViewManager.kt +36 -15
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ui/ScanditViewGroupManager.kt +2 -8
- package/dist/core.js +48 -1
- package/dist/core.js.map +1 -1
- package/dist/dts/DataCaptureView.d.ts +2 -0
- package/dist/index.js +15 -21
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ios/Sources/ScanditDataCaptureCore.swift +3 -1
- package/ios/Sources/ScanditDataCaptureViewManager.swift +16 -11
- package/package.json +2 -2
- package/scandit-react-native-datacapture-core.podspec +1 -1
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ui/FragmentBase.kt +0 -11
|
@@ -13,11 +13,13 @@ class RNTSDCDataCaptureViewWrapper: UIView {
|
|
|
13
13
|
|
|
14
14
|
override func removeFromSuperview() {
|
|
15
15
|
if let viewManager = viewManager,
|
|
16
|
-
let index =
|
|
17
|
-
|
|
16
|
+
let index = RNTSDCDataCaptureViewManager.containers.firstIndex(of: self) {
|
|
17
|
+
dispatchMain {
|
|
18
|
+
RNTSDCDataCaptureViewManager.containers.remove(at: index)
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
if let droppedView =
|
|
20
|
-
|
|
21
|
+
if let droppedView = RNTSDCDataCaptureViewManager.dataCaptureView {
|
|
22
|
+
RNTSDCDataCaptureViewManager.dataCaptureView = nil
|
|
21
23
|
// on iOS we don't have a callback like the android onDropViewInstance where we can remove the dropped instance.
|
|
22
24
|
// here we just override the willRemoveSubview of the wrapper and notify the core module that the dcview has been removed.
|
|
23
25
|
DeserializationLifeCycleDispatcher.shared.dispatchDataCaptureViewRemoved(view: droppedView)
|
|
@@ -32,9 +34,9 @@ class RNTSDCDataCaptureViewWrapper: UIView {
|
|
|
32
34
|
@objc(RNTSDCDataCaptureViewManager)
|
|
33
35
|
class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObserver {
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
static var containers: [RNTSDCDataCaptureViewWrapper] = []
|
|
36
38
|
|
|
37
|
-
var dataCaptureView: DataCaptureView? {
|
|
39
|
+
static var dataCaptureView: DataCaptureView? {
|
|
38
40
|
didSet {
|
|
39
41
|
guard let container = containers.last else {
|
|
40
42
|
return
|
|
@@ -67,12 +69,12 @@ class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObse
|
|
|
67
69
|
var isObserving = false
|
|
68
70
|
|
|
69
71
|
func addCaptureViewToLastContainer() {
|
|
70
|
-
guard let container = containers.last,
|
|
72
|
+
guard let container = RNTSDCDataCaptureViewManager.containers.last,
|
|
71
73
|
let captureView = DataCaptureViewHandler.shared.topmostDataCaptureView else {
|
|
72
74
|
return
|
|
73
75
|
}
|
|
74
|
-
|
|
75
|
-
dataCaptureView = captureView
|
|
76
|
+
|
|
77
|
+
RNTSDCDataCaptureViewManager.dataCaptureView = captureView
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
override func view() -> UIView! {
|
|
@@ -83,7 +85,7 @@ class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObse
|
|
|
83
85
|
|
|
84
86
|
let container = RNTSDCDataCaptureViewWrapper()
|
|
85
87
|
|
|
86
|
-
if let dataCaptureview = dataCaptureView {
|
|
88
|
+
if let dataCaptureview = RNTSDCDataCaptureViewManager.dataCaptureView {
|
|
87
89
|
if dataCaptureview.superview != nil {
|
|
88
90
|
dataCaptureview.removeFromSuperview()
|
|
89
91
|
}
|
|
@@ -92,7 +94,10 @@ class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObse
|
|
|
92
94
|
container.addSubview(dataCaptureview)
|
|
93
95
|
}
|
|
94
96
|
container.viewManager = self
|
|
95
|
-
|
|
97
|
+
|
|
98
|
+
dispatchMain {
|
|
99
|
+
RNTSDCDataCaptureViewManager.containers.append(container)
|
|
100
|
+
}
|
|
96
101
|
|
|
97
102
|
return container
|
|
98
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scandit-react-native-datacapture-core",
|
|
3
|
-
"version": "6.28.
|
|
3
|
+
"version": "6.28.2",
|
|
4
4
|
"description": "Scandit Data Capture SDK for React Native",
|
|
5
5
|
"homepage": "https://github.com/Scandit/scandit-react-native-datacapture-core",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"typescript": "4.9.5"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"scandit-datacapture-frameworks-core": "6.28.
|
|
52
|
+
"scandit-datacapture-frameworks-core": "6.28.2"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -18,6 +18,6 @@ Pod::Spec.new do |s|
|
|
|
18
18
|
s.module_name = "ScanditDataCaptureCore"
|
|
19
19
|
s.header_dir = "ScanditDataCaptureCore"
|
|
20
20
|
|
|
21
|
-
s.dependency "scandit-datacapture-frameworks-core", '= 6.28.
|
|
21
|
+
s.dependency "scandit-datacapture-frameworks-core", '= 6.28.2'
|
|
22
22
|
s.dependency "React"
|
|
23
23
|
end
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the Scandit Data Capture SDK
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2024- Scandit AG. All rights reserved.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
package com.scandit.datacapture.reactnative.core.ui
|
|
8
|
-
|
|
9
|
-
import androidx.fragment.app.Fragment
|
|
10
|
-
|
|
11
|
-
abstract class FragmentBase : Fragment()
|