scandit-react-native-datacapture-core 6.16.0 → 6.16.1
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
CHANGED
|
@@ -7,60 +7,67 @@
|
|
|
7
7
|
import Foundation
|
|
8
8
|
import ScanditCaptureCore
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
internal var container = UIView()
|
|
10
|
+
class RNTSDCDataCaptureViewWrapper: UIView {
|
|
11
|
+
weak var viewManager: RNTSDCDataCaptureViewManager?
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
didSet {
|
|
21
|
-
guard let dataCaptureView = dataCaptureView else { return }
|
|
22
|
-
dataCaptureView.frame = container.bounds
|
|
23
|
-
dataCaptureView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
24
|
-
container.addSubview(dataCaptureView)
|
|
13
|
+
override func removeFromSuperview() {
|
|
14
|
+
if let viewManager = viewManager,
|
|
15
|
+
let index = viewManager.containers.firstIndex(of: self) {
|
|
16
|
+
viewManager.containers.remove(at: index)
|
|
17
|
+
viewManager.addCaptureViewToLastContainer()
|
|
25
18
|
}
|
|
19
|
+
super.removeFromSuperview()
|
|
26
20
|
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@objc(RNTSDCDataCaptureViewManager)
|
|
24
|
+
class RNTSDCDataCaptureViewManager: RCTViewManager {
|
|
25
|
+
|
|
26
|
+
internal var containers: [RNTSDCDataCaptureViewWrapper] = []
|
|
27
27
|
|
|
28
28
|
override class func requiresMainQueueSetup() -> Bool {
|
|
29
29
|
true
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
var isObserving = false
|
|
33
|
+
|
|
34
|
+
func addCaptureViewToLastContainer() {
|
|
35
|
+
guard let container = containers.last,
|
|
36
|
+
let coreModule = bridge.module(for: ScanditDataCaptureCore.self) as? ScanditDataCaptureCore,
|
|
37
|
+
let captureView = coreModule.dataCaptureView else {
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
if captureView.superview != nil {
|
|
41
|
+
captureView.removeFromSuperview()
|
|
35
42
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
captureView.frame = container.bounds
|
|
44
|
+
captureView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
45
|
+
container.addSubview(captureView)
|
|
39
46
|
}
|
|
40
47
|
|
|
41
|
-
var isObserving = false
|
|
42
|
-
|
|
43
48
|
override func view() -> UIView! {
|
|
44
49
|
|
|
45
|
-
if !isObserving
|
|
50
|
+
if !isObserving {
|
|
46
51
|
isObserving = true
|
|
47
|
-
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
guard let coreModule = bridge.module(for: ScanditDataCaptureCore.self) as? ScanditDataCaptureCore else {
|
|
55
|
+
return nil
|
|
48
56
|
}
|
|
49
57
|
|
|
50
|
-
container =
|
|
58
|
+
let container = RNTSDCDataCaptureViewWrapper()
|
|
51
59
|
|
|
52
|
-
if let dataCaptureview = dataCaptureView {
|
|
60
|
+
if let dataCaptureview = coreModule.dataCaptureView {
|
|
61
|
+
if dataCaptureview.superview != nil {
|
|
62
|
+
dataCaptureview.removeFromSuperview()
|
|
63
|
+
}
|
|
53
64
|
dataCaptureview.frame = container.bounds
|
|
54
65
|
dataCaptureview.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
55
66
|
container.addSubview(dataCaptureview)
|
|
56
67
|
}
|
|
68
|
+
container.viewManager = self
|
|
69
|
+
containers.append(container)
|
|
57
70
|
|
|
58
71
|
return container
|
|
59
72
|
}
|
|
60
|
-
|
|
61
|
-
func didUpdate(dataCaptureView: DataCaptureView?) {
|
|
62
|
-
DispatchQueue.main.async {
|
|
63
|
-
self.dataCaptureView = dataCaptureView
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
73
|
}
|
package/js/DataCaptureVersion.js
CHANGED
package/js/Feedback.js
CHANGED
|
@@ -59,7 +59,7 @@ var Vibration = /** @class */ (function (_super) {
|
|
|
59
59
|
configurable: true
|
|
60
60
|
});
|
|
61
61
|
Vibration.fromJSON = function (json) {
|
|
62
|
-
if (json.type ===
|
|
62
|
+
if (json.type === 'waveForm') {
|
|
63
63
|
return new WaveFormVibration(json.timings, json.amplitudes);
|
|
64
64
|
}
|
|
65
65
|
return new Vibration(json.type);
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.requires_arc = true
|
|
17
17
|
s.module_name = "ScanditDataCaptureCore"
|
|
18
18
|
s.header_dir = "ScanditDataCaptureCore"
|
|
19
|
-
s.dependency 'ScanditCaptureCore', '= 6.16.
|
|
19
|
+
s.dependency 'ScanditCaptureCore', '= 6.16.1'
|
|
20
20
|
|
|
21
21
|
s.dependency "React"
|
|
22
22
|
end
|