scandit-capacitor-datacapture-barcode 6.20.0 → 6.21.0-beta.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/ScanditCapacitorDatacaptureBarcode.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ScanditBarcodeNative.kt +196 -10
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/count/BarcodeCountViewHandler.kt +14 -7
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/find/BarcodeFindViewHandler.kt +144 -0
- package/dist/barcode.js +4146 -0
- package/dist/barcode.js.map +1 -0
- package/dist/dts/definitions.d.ts +112 -0
- package/dist/dts/ts/BarcodeCountView.d.ts +173 -0
- package/dist/dts/ts/BarcodeTrackingAdvancedOverlay.d.ts +19 -0
- package/dist/dts/ts/BarcodeTrackingAdvancedOverlayListener.d.ts +10 -0
- package/dist/dts/ts/Capacitor/BarcodeCaptureListenerProxy.d.ts +18 -0
- package/dist/dts/ts/Capacitor/BarcodeCountListenerProxy.d.ts +18 -0
- package/dist/dts/ts/Capacitor/BarcodeCountSessionProxy.d.ts +6 -0
- package/dist/dts/ts/Capacitor/BarcodeCountViewProxy.d.ts +29 -0
- package/dist/dts/ts/Capacitor/BarcodeSelectionListenerProxy.d.ts +16 -0
- package/dist/dts/ts/Capacitor/BarcodeSelectionProxy.d.ts +11 -0
- package/dist/dts/ts/Capacitor/BarcodeTrackingAdvancedOverlayProxy.d.ts +22 -0
- package/dist/dts/ts/Capacitor/BarcodeTrackingBasicOverlayProxy.d.ts +13 -0
- package/dist/dts/ts/Capacitor/BarcodeTrackingListenerProxy.d.ts +13 -0
- package/dist/{esm/scandit-capacitor-datacapture-barcode/src → dts}/ts/Capacitor/Capacitor.d.ts +7 -4
- package/dist/dts/ts/Capacitor/initBarcodeProxy.d.ts +1 -0
- package/dist/dts/ts/TrackedBarcodeView.d.ts +24 -0
- package/dist/{esm/scandit-capacitor-datacapture-barcode/src → dts}/web.d.ts +2 -1
- package/dist/index.js +2269 -0
- package/dist/index.js.map +1 -0
- package/ios/Plugin/Plugin.m +6 -1
- package/ios/Plugin/ScanditBarcodeCapture.swift +33 -3
- package/package.json +14 -10
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/definitions.d.ts +0 -2063
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/definitions.js +0 -2
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/definitions.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/index.js +0 -3
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/index.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Barcode.js +0 -274
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Barcode.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCapture+Related.js +0 -120
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCapture+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCapture.js +0 -103
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCapture.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCaptureSettings.js +0 -58
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCaptureSettings.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCount+Related.js +0 -69
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCount+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCount.js +0 -134
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCount.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountCaptureList.js +0 -57
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountCaptureList.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountSettings.js +0 -54
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountSettings.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountView+Related.js +0 -31
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountView+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountView.js +0 -645
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountView.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeFilterSettings.js +0 -103
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeFilterSettings.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelection+Related.js +0 -280
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelection+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelection.js +0 -121
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelection.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelectionSettings.js +0 -47
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelectionSettings.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTracking+Related.js +0 -205
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTracking+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTracking.js +0 -84
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTracking.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTrackingSettings.js +0 -45
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTrackingSettings.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCaptureListenerProxy.js +0 -83
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCaptureListenerProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountDefaults.d.ts +0 -146
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountDefaults.js +0 -38
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountDefaults.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountListenerProxy.js +0 -89
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountListenerProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountViewProxy.js +0 -242
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountViewProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeSelectionListenerProxy.js +0 -79
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeSelectionListenerProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeSelectionProxy.js +0 -15
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeSelectionProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingAdvancedOverlayProxy.js +0 -112
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingAdvancedOverlayProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingBasicOverlayProxy.js +0 -67
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingBasicOverlayProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingListenerProxy.js +0 -54
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingListenerProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Capacitor.js +0 -65
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Capacitor.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Defaults.d.ts +0 -115
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Defaults.js +0 -145
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Defaults.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/TrackedBarcodeView.js +0 -62
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/TrackedBarcodeView.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/web.js +0 -103
- package/dist/esm/scandit-capacitor-datacapture-barcode/src/web.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Camera+Related.js +0 -163
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Camera+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Camera.js +0 -122
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Camera.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CameraProxy.js +0 -35
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CameraProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Capacitor.d.ts +0 -34
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Capacitor.js +0 -54
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Capacitor.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor.d.ts +0 -11
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor.js +0 -61
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/DataCaptureContextProxy.js +0 -69
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/DataCaptureContextProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/DataCaptureViewProxy.js +0 -73
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/DataCaptureViewProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Defaults.d.ts +0 -169
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Defaults.js +0 -79
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Defaults.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/FeedbackProxy.js +0 -12
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/FeedbackProxy.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Common.js +0 -467
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Common.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureContext+Related.js +0 -19
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureContext+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureContext.js +0 -136
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureContext.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureView+Related.js +0 -39
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureView+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureView.js +0 -352
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureView.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Feedback.js +0 -94
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Feedback.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/LocationSelection.js +0 -53
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/LocationSelection.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Serializeable.js +0 -67
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Serializeable.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Viewfinder+Related.js +0 -43
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Viewfinder+Related.js.map +0 -1
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Viewfinder.js +0 -133
- package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Viewfinder.js.map +0 -1
- package/dist/plugin.js +0 -5050
- package/dist/plugin.js.map +0 -1
- /package/dist/{esm/scandit-capacitor-datacapture-barcode/src → dts}/index.d.ts +0 -0
|
@@ -17,5 +17,5 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
|
|
18
18
|
s.dependency "Capacitor"
|
|
19
19
|
s.dependency "ScanditCapacitorDatacaptureCore", "= #{version}"
|
|
20
|
-
s.dependency "scandit-datacapture-frameworks-barcode", '= 6.
|
|
20
|
+
s.dependency "scandit-datacapture-frameworks-barcode", '= 6.21.0-beta.2'
|
|
21
21
|
end
|
package/android/build.gradle
CHANGED
package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ScanditBarcodeNative.kt
CHANGED
|
@@ -17,6 +17,7 @@ import com.getcapacitor.PluginMethod
|
|
|
17
17
|
import com.getcapacitor.annotation.CapacitorPlugin
|
|
18
18
|
import com.scandit.capacitor.datacapture.barcode.count.BarcodeCountViewHandler
|
|
19
19
|
import com.scandit.capacitor.datacapture.barcode.factories.BarcodeCaptureActionFactory
|
|
20
|
+
import com.scandit.capacitor.datacapture.barcode.find.BarcodeFindViewHandler
|
|
20
21
|
import com.scandit.capacitor.datacapture.barcode.utils.SerializableAdvancedOverlayViewData
|
|
21
22
|
import com.scandit.capacitor.datacapture.core.ScanditCaptureCoreNative
|
|
22
23
|
import com.scandit.capacitor.datacapture.core.data.ResizeAndMoveInfo
|
|
@@ -33,6 +34,9 @@ import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarc
|
|
|
33
34
|
import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarcodeCountListener
|
|
34
35
|
import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarcodeCountViewListener
|
|
35
36
|
import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarcodeCountViewUiListener
|
|
37
|
+
import com.scandit.datacapture.frameworks.barcode.find.BarcodeFindModule
|
|
38
|
+
import com.scandit.datacapture.frameworks.barcode.find.listeners.FrameworksBarcodeFindListener
|
|
39
|
+
import com.scandit.datacapture.frameworks.barcode.find.listeners.FrameworksBarcodeFindViewUiListener
|
|
36
40
|
import com.scandit.datacapture.frameworks.barcode.selection.BarcodeSelectionModule
|
|
37
41
|
import com.scandit.datacapture.frameworks.barcode.selection.listeners.FrameworksBarcodeSelectionAimedBrushProvider
|
|
38
42
|
import com.scandit.datacapture.frameworks.barcode.selection.listeners.FrameworksBarcodeSelectionListener
|
|
@@ -43,6 +47,9 @@ import com.scandit.datacapture.frameworks.barcode.tracking.listeners.FrameworksB
|
|
|
43
47
|
import com.scandit.datacapture.frameworks.barcode.tracking.listeners.FrameworksBarcodeTrackingListener
|
|
44
48
|
import com.scandit.datacapture.frameworks.core.deserialization.DeserializationLifecycleObserver
|
|
45
49
|
import com.scandit.datacapture.frameworks.core.events.Emitter
|
|
50
|
+
import com.scandit.datacapture.frameworks.core.utils.DefaultFrameworksLog
|
|
51
|
+
import com.scandit.datacapture.frameworks.core.utils.DefaultMainThread
|
|
52
|
+
import com.scandit.datacapture.frameworks.core.utils.DefaultWorkerThread
|
|
46
53
|
import com.scandit.datacapture.frameworks.core.utils.FrameworksLog
|
|
47
54
|
import com.scandit.datacapture.frameworks.core.utils.MainThread
|
|
48
55
|
import com.scandit.datacapture.frameworks.core.utils.WorkerThread
|
|
@@ -81,7 +88,16 @@ class ScanditBarcodeNative :
|
|
|
81
88
|
FrameworksBarcodeCountViewUiListener(this)
|
|
82
89
|
)
|
|
83
90
|
|
|
91
|
+
private val barcodeFindModule = BarcodeFindModule(
|
|
92
|
+
FrameworksBarcodeFindListener(this),
|
|
93
|
+
FrameworksBarcodeFindViewUiListener(this)
|
|
94
|
+
)
|
|
95
|
+
|
|
84
96
|
private val barcodeCountViewHandler: BarcodeCountViewHandler = BarcodeCountViewHandler()
|
|
97
|
+
private val barcodeFindViewHandler: BarcodeFindViewHandler = BarcodeFindViewHandler()
|
|
98
|
+
private val logger: FrameworksLog = DefaultFrameworksLog.getInstance()
|
|
99
|
+
private val workerThread: WorkerThread = DefaultWorkerThread.getInstance()
|
|
100
|
+
private val mainThread: MainThread = DefaultMainThread.getInstance()
|
|
85
101
|
|
|
86
102
|
override fun load() {
|
|
87
103
|
super.load()
|
|
@@ -93,10 +109,12 @@ class ScanditBarcodeNative :
|
|
|
93
109
|
pluginHandle.instance
|
|
94
110
|
)
|
|
95
111
|
} else {
|
|
96
|
-
|
|
112
|
+
logger.error("Core not found")
|
|
113
|
+
}
|
|
114
|
+
mainThread.runOnMainThread {
|
|
115
|
+
barcodeCountViewHandler.attachWebView(bridge.webView, bridge.activity)
|
|
116
|
+
barcodeFindViewHandler.attachWebView(bridge.webView)
|
|
97
117
|
}
|
|
98
|
-
|
|
99
|
-
barcodeCountViewHandler.attachWebView(bridge.webView, bridge.activity)
|
|
100
118
|
DeserializationLifecycleObserver.attach(this)
|
|
101
119
|
|
|
102
120
|
barcodeModule.onCreate(context)
|
|
@@ -104,6 +122,7 @@ class ScanditBarcodeNative :
|
|
|
104
122
|
barcodeTrackingModule.onCreate(context)
|
|
105
123
|
barcodeSelectionModule.onCreate(context)
|
|
106
124
|
barcodeCountModule.onCreate(context)
|
|
125
|
+
barcodeFindModule.onCreate(context)
|
|
107
126
|
}
|
|
108
127
|
|
|
109
128
|
override fun handleOnDestroy() {
|
|
@@ -112,6 +131,7 @@ class ScanditBarcodeNative :
|
|
|
112
131
|
barcodeTrackingModule.onDestroy()
|
|
113
132
|
barcodeSelectionModule.onDestroy()
|
|
114
133
|
barcodeCountModule.onDestroy()
|
|
134
|
+
barcodeFindModule.onDestroy()
|
|
115
135
|
}
|
|
116
136
|
|
|
117
137
|
@PluginMethod
|
|
@@ -153,10 +173,11 @@ class ScanditBarcodeNative :
|
|
|
153
173
|
JSONObject(
|
|
154
174
|
|
|
155
175
|
barcodeModule.getDefaults() +
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
176
|
+
mapOf("BarcodeCapture" to barcodeCaptureModule.getDefaults()) +
|
|
177
|
+
mapOf("BarcodeTracking" to barcodeTrackingModule.getDefaults()) +
|
|
178
|
+
mapOf("BarcodeSelection" to barcodeSelectionModule.getDefaults()) +
|
|
179
|
+
mapOf("BarcodeCount" to barcodeCountModule.getDefaults()) +
|
|
180
|
+
mapOf("BarcodeFind" to barcodeFindModule.getDefaults())
|
|
160
181
|
|
|
161
182
|
)
|
|
162
183
|
)
|
|
@@ -170,6 +191,12 @@ class ScanditBarcodeNative :
|
|
|
170
191
|
call.resolve()
|
|
171
192
|
}
|
|
172
193
|
|
|
194
|
+
@PluginMethod
|
|
195
|
+
fun setBarcodeCaptureModeEnabledState(call: PluginCall) {
|
|
196
|
+
barcodeCaptureModule.setModeEnabled(call.data.getBoolean("enabled"))
|
|
197
|
+
call.resolve()
|
|
198
|
+
}
|
|
199
|
+
|
|
173
200
|
@PluginMethod
|
|
174
201
|
fun subscribeBarcodeTrackingListener(call: PluginCall) {
|
|
175
202
|
barcodeTrackingModule.addBarcodeTrackingListener()
|
|
@@ -182,6 +209,12 @@ class ScanditBarcodeNative :
|
|
|
182
209
|
call.resolve()
|
|
183
210
|
}
|
|
184
211
|
|
|
212
|
+
@PluginMethod
|
|
213
|
+
fun setBarcodeTrackingModeEnabledState(call: PluginCall) {
|
|
214
|
+
barcodeTrackingModule.setModeEnabled(call.data.getBoolean("enabled"))
|
|
215
|
+
call.resolve()
|
|
216
|
+
}
|
|
217
|
+
|
|
185
218
|
@PluginMethod
|
|
186
219
|
fun subscribeBarcodeTrackingBasicOverlayListener(call: PluginCall) {
|
|
187
220
|
barcodeTrackingModule.addBasicOverlayListener()
|
|
@@ -221,12 +254,12 @@ class ScanditBarcodeNative :
|
|
|
221
254
|
@PluginMethod
|
|
222
255
|
fun setViewForTrackedBarcode(call: PluginCall) {
|
|
223
256
|
try {
|
|
224
|
-
|
|
257
|
+
workerThread.runOnBackgroundThread {
|
|
225
258
|
val serializationData = SerializableAdvancedOverlayViewData(call.data)
|
|
226
259
|
|
|
227
260
|
val image = getBitmapFromBase64EncodedViewData(serializationData.view?.data)
|
|
228
261
|
|
|
229
|
-
|
|
262
|
+
mainThread.runOnMainThread {
|
|
230
263
|
val view = barcodeTrackingModule.getTrackedBarcodeViewFromBitmap(
|
|
231
264
|
serializationData.trackedBarcodeId,
|
|
232
265
|
image
|
|
@@ -356,6 +389,12 @@ class ScanditBarcodeNative :
|
|
|
356
389
|
call.resolve()
|
|
357
390
|
}
|
|
358
391
|
|
|
392
|
+
@PluginMethod
|
|
393
|
+
fun setBarcodeSelectionModeEnabledState(call: PluginCall) {
|
|
394
|
+
barcodeSelectionModule.setModeEnabled(call.data.getBoolean("enabled"))
|
|
395
|
+
call.resolve()
|
|
396
|
+
}
|
|
397
|
+
|
|
359
398
|
//region BarcodeCount
|
|
360
399
|
|
|
361
400
|
//region Barcode Count Listener
|
|
@@ -500,6 +539,28 @@ class ScanditBarcodeNative :
|
|
|
500
539
|
call.resolve()
|
|
501
540
|
}
|
|
502
541
|
|
|
542
|
+
@PluginMethod
|
|
543
|
+
fun getSpatialMap(call: PluginCall) {
|
|
544
|
+
val map = barcodeCountModule.getSpatialMap()
|
|
545
|
+
call.resolve(JSObject.fromJSONObject(JSONObject(map?.toJson() ?: "{}")))
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
@PluginMethod
|
|
549
|
+
fun getSpatialMapWithHints(call: PluginCall) {
|
|
550
|
+
val expectedNumberOfRows = call.data.getInteger("expectedNumberOfRows")
|
|
551
|
+
?: return call.reject("No expectedNumberOfRows was provided for the function.")
|
|
552
|
+
val expectedNumberOfColumns = call.data.getInteger("expectedNumberOfColumns")
|
|
553
|
+
?: return call.reject("No expectedNumberOfColumns was provided for the function.")
|
|
554
|
+
val map = barcodeCountModule.getSpatialMap(expectedNumberOfRows, expectedNumberOfColumns)
|
|
555
|
+
call.resolve(JSObject.fromJSONObject(JSONObject(map?.toJson() ?: "{}")))
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
@PluginMethod
|
|
559
|
+
fun setBarcodeCountModeEnabledState(call: PluginCall) {
|
|
560
|
+
barcodeCountModule.setModeEnabled(call.data.getBoolean("enabled"))
|
|
561
|
+
call.resolve()
|
|
562
|
+
}
|
|
563
|
+
|
|
503
564
|
//endregion
|
|
504
565
|
|
|
505
566
|
@PluginMethod
|
|
@@ -566,6 +627,131 @@ class ScanditBarcodeNative :
|
|
|
566
627
|
|
|
567
628
|
private fun checkFinishCallbackIdFieldForValue(data: JSONObject, value: String): Boolean {
|
|
568
629
|
return data.has(SerializableCallbackAction.FIELD_FINISH_CALLBACK_ID) &&
|
|
569
|
-
|
|
630
|
+
data[SerializableCallbackAction.FIELD_FINISH_CALLBACK_ID] == value
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
//region Barcode Find
|
|
635
|
+
|
|
636
|
+
@PluginMethod
|
|
637
|
+
fun createFindView(
|
|
638
|
+
call: PluginCall
|
|
639
|
+
) {
|
|
640
|
+
val viewJson = call.data.toString()
|
|
641
|
+
val container = barcodeFindViewHandler.prepareContainer(this.context)
|
|
642
|
+
|
|
643
|
+
val result = barcodeFindModule.getView(container, viewJson)
|
|
644
|
+
if (result.isFailure) {
|
|
645
|
+
call.reject(
|
|
646
|
+
result.exceptionOrNull()?.message
|
|
647
|
+
?: "Unable to create the BarcodeFindView from the given json=$viewJson"
|
|
648
|
+
)
|
|
649
|
+
return
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
barcodeFindViewHandler.addBarcodeFindViewContainer(container, bridge.activity)
|
|
653
|
+
barcodeCountViewHandler.render()
|
|
654
|
+
call.resolve()
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
@PluginMethod
|
|
658
|
+
fun updateFindView(call: PluginCall) {
|
|
659
|
+
barcodeFindModule.updateBarcodeFindView(
|
|
660
|
+
call.data["BarcodeFindView"].toString(),
|
|
661
|
+
CapacitorResult(call)
|
|
662
|
+
)
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
@PluginMethod
|
|
666
|
+
fun updateFindMode(call: PluginCall) {
|
|
667
|
+
barcodeFindModule.updateBarcodeFindMode(
|
|
668
|
+
call.data["BarcodeFind"].toString(),
|
|
669
|
+
CapacitorResult(call)
|
|
670
|
+
)
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
@PluginMethod
|
|
674
|
+
fun registerBarcodeFindListener(call: PluginCall) {
|
|
675
|
+
barcodeFindModule.addBarcodeFindListener(CapacitorResult(call))
|
|
570
676
|
}
|
|
677
|
+
|
|
678
|
+
@PluginMethod
|
|
679
|
+
fun unregisterBarcodeFindListener(call: PluginCall) {
|
|
680
|
+
barcodeFindModule.removeBarcodeFindListener(CapacitorResult(call))
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
@PluginMethod
|
|
684
|
+
fun registerBarcodeFindViewListener(call: PluginCall) {
|
|
685
|
+
barcodeFindModule.addBarcodeFindViewListener(CapacitorResult(call))
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
@PluginMethod
|
|
689
|
+
fun unregisterBarcodeFindViewListener(call: PluginCall) {
|
|
690
|
+
barcodeFindModule.removeBarcodeFindViewListener(CapacitorResult(call))
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
@PluginMethod
|
|
694
|
+
fun barcodeFindViewOnPause(call: PluginCall) {
|
|
695
|
+
barcodeFindModule.viewOnPause(CapacitorResult(call))
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
@PluginMethod
|
|
699
|
+
fun barcodeFindViewOnResume(call: PluginCall) {
|
|
700
|
+
barcodeFindModule.viewOnResume(CapacitorResult(call))
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
@PluginMethod
|
|
704
|
+
fun barcodeFindSetItemList(barcodeFindItemsJson: String, call: PluginCall) {
|
|
705
|
+
barcodeFindModule.setItemList(barcodeFindItemsJson, CapacitorResult(call))
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
@PluginMethod
|
|
709
|
+
fun barcodeFindViewStopSearching(call: PluginCall) {
|
|
710
|
+
barcodeFindModule.viewStopSearching(CapacitorResult(call))
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
@PluginMethod
|
|
714
|
+
fun barcodeFindViewStartSearching(call: PluginCall) {
|
|
715
|
+
barcodeFindModule.viewStartSearching(CapacitorResult(call))
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
@PluginMethod
|
|
719
|
+
fun barcodeFindViewPauseSearching(call: PluginCall) {
|
|
720
|
+
barcodeFindModule.viewPauseSearching(CapacitorResult(call))
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
@PluginMethod
|
|
724
|
+
fun barcodeFindModeStart(call: PluginCall) {
|
|
725
|
+
barcodeFindModule.modeStart(CapacitorResult(call))
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
@PluginMethod
|
|
729
|
+
fun barcodeFindModePause(call: PluginCall) {
|
|
730
|
+
barcodeFindModule.modePause(CapacitorResult(call))
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
@PluginMethod
|
|
734
|
+
fun barcodeFindModeStop(call: PluginCall) {
|
|
735
|
+
barcodeFindModule.modeStop(CapacitorResult(call))
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
@PluginMethod
|
|
739
|
+
fun showFindView(call: PluginCall) {
|
|
740
|
+
barcodeFindViewHandler.setVisible()
|
|
741
|
+
call.resolve()
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
@PluginMethod
|
|
745
|
+
fun hideFindView(call: PluginCall) {
|
|
746
|
+
barcodeFindViewHandler.setInvisible()
|
|
747
|
+
call.resolve()
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
@PluginMethod
|
|
751
|
+
fun setBarcodeFindModeEnabledState(call: PluginCall) {
|
|
752
|
+
barcodeFindModule.setModeEnabled(call.data.getBoolean("enabled"))
|
|
753
|
+
call.resolve()
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
//endregion
|
|
571
757
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the Scandit Data Capture SDK
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023- Scandit AG. All rights reserved.
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
package com.scandit.capacitor.datacapture.barcode.count
|
|
2
8
|
|
|
3
9
|
import android.graphics.Color
|
|
@@ -8,10 +14,13 @@ import com.scandit.capacitor.datacapture.core.data.ResizeAndMoveInfo
|
|
|
8
14
|
import com.scandit.capacitor.datacapture.core.utils.pxFromDp
|
|
9
15
|
import com.scandit.capacitor.datacapture.core.utils.removeFromParent
|
|
10
16
|
import com.scandit.datacapture.barcode.count.ui.view.BarcodeCountView
|
|
17
|
+
import com.scandit.datacapture.frameworks.core.utils.DefaultMainThread
|
|
11
18
|
import com.scandit.datacapture.frameworks.core.utils.MainThread
|
|
12
19
|
import java.lang.ref.WeakReference
|
|
13
20
|
|
|
14
|
-
internal class BarcodeCountViewHandler
|
|
21
|
+
internal class BarcodeCountViewHandler (
|
|
22
|
+
private val mainThread: MainThread = DefaultMainThread.getInstance()
|
|
23
|
+
) {
|
|
15
24
|
private var latestInfo: ResizeAndMoveInfo = ResizeAndMoveInfo(0, 0, 600, 600, false)
|
|
16
25
|
private var isVisible: Boolean = true
|
|
17
26
|
private var barcodeCountViewReference: WeakReference<BarcodeCountView>? = null
|
|
@@ -33,10 +42,8 @@ internal class BarcodeCountViewHandler {
|
|
|
33
42
|
fun attachWebView(webView: View, @Suppress("UNUSED_PARAMETER") activity: AppCompatActivity) {
|
|
34
43
|
if (this.webView != webView) {
|
|
35
44
|
webViewReference = WeakReference(webView)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
webView.setBackgroundColor(Color.TRANSPARENT)
|
|
39
|
-
}
|
|
45
|
+
webView.bringToFront()
|
|
46
|
+
webView.setBackgroundColor(Color.TRANSPARENT)
|
|
40
47
|
}
|
|
41
48
|
}
|
|
42
49
|
|
|
@@ -75,7 +82,7 @@ internal class BarcodeCountViewHandler {
|
|
|
75
82
|
) {
|
|
76
83
|
barcodeCountViewReference = WeakReference(barcodeCountView)
|
|
77
84
|
|
|
78
|
-
|
|
85
|
+
mainThread.runOnMainThread {
|
|
79
86
|
activity.addContentView(
|
|
80
87
|
barcodeCountView,
|
|
81
88
|
ViewGroup.LayoutParams(
|
|
@@ -96,7 +103,7 @@ internal class BarcodeCountViewHandler {
|
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
private fun removeView(view: View, uiBlock: (() -> Unit)? = null) {
|
|
99
|
-
|
|
106
|
+
mainThread.runOnMainThread {
|
|
100
107
|
view.removeFromParent()
|
|
101
108
|
uiBlock?.invoke()
|
|
102
109
|
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the Scandit Data Capture SDK
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023- Scandit AG. All rights reserved.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
package com.scandit.capacitor.datacapture.barcode.find
|
|
8
|
+
|
|
9
|
+
import android.content.Context
|
|
10
|
+
import android.graphics.Color
|
|
11
|
+
import android.view.View
|
|
12
|
+
import android.view.ViewGroup
|
|
13
|
+
import android.widget.FrameLayout
|
|
14
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
15
|
+
import androidx.core.view.children
|
|
16
|
+
import com.scandit.capacitor.datacapture.core.data.ResizeAndMoveInfo
|
|
17
|
+
import com.scandit.capacitor.datacapture.core.utils.pxFromDp
|
|
18
|
+
import com.scandit.capacitor.datacapture.core.utils.removeFromParent
|
|
19
|
+
import com.scandit.datacapture.barcode.find.ui.BarcodeFindView
|
|
20
|
+
import com.scandit.datacapture.frameworks.core.utils.DefaultMainThread
|
|
21
|
+
import com.scandit.datacapture.frameworks.core.utils.MainThread
|
|
22
|
+
import java.lang.ref.WeakReference
|
|
23
|
+
|
|
24
|
+
class BarcodeFindViewHandler(
|
|
25
|
+
private val mainThread: MainThread = DefaultMainThread.getInstance()
|
|
26
|
+
) {
|
|
27
|
+
private var latestInfo: ResizeAndMoveInfo = ResizeAndMoveInfo(0, 0, 600, 600, false)
|
|
28
|
+
private var isVisible: Boolean = true
|
|
29
|
+
private var barcodeFindViewContainerReference: WeakReference<FrameLayout>? = null
|
|
30
|
+
private var webViewReference: WeakReference<View>? = null
|
|
31
|
+
|
|
32
|
+
val barcodeFindViewContainer: FrameLayout?
|
|
33
|
+
get() = barcodeFindViewContainerReference?.get()
|
|
34
|
+
|
|
35
|
+
private val webView: View?
|
|
36
|
+
get() = webViewReference?.get()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
fun prepareContainer(context: Context) : FrameLayout {
|
|
40
|
+
return FrameLayout(context)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fun addBarcodeFindViewContainer(container: FrameLayout, activity: AppCompatActivity) {
|
|
44
|
+
if (this.barcodeFindViewContainer != container) {
|
|
45
|
+
disposeCurrentView()
|
|
46
|
+
addContainer(container, activity)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
fun attachWebView(webView: View) {
|
|
51
|
+
if (this.webView != webView) {
|
|
52
|
+
webViewReference = WeakReference(webView)
|
|
53
|
+
webView.bringToFront()
|
|
54
|
+
webView.setBackgroundColor(Color.TRANSPARENT)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
fun setVisible() {
|
|
59
|
+
isVisible = true
|
|
60
|
+
render()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
fun setInvisible() {
|
|
64
|
+
isVisible = false
|
|
65
|
+
render()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
fun setResizeAndMoveInfo(info: ResizeAndMoveInfo) {
|
|
69
|
+
latestInfo = info
|
|
70
|
+
render()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fun disposeCurrent() {
|
|
74
|
+
disposeCurrentView()
|
|
75
|
+
disposeCurrentWebView()
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private fun disposeCurrentView() {
|
|
79
|
+
val view = barcodeFindViewContainer ?: return
|
|
80
|
+
removeView(view)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private fun disposeCurrentWebView() {
|
|
84
|
+
webViewReference = null
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private fun addContainer(
|
|
88
|
+
barcodeFindViewContainer: FrameLayout,
|
|
89
|
+
activity: AppCompatActivity
|
|
90
|
+
) {
|
|
91
|
+
barcodeFindViewContainerReference = WeakReference(barcodeFindViewContainer)
|
|
92
|
+
|
|
93
|
+
mainThread.runOnMainThread {
|
|
94
|
+
activity.addContentView(
|
|
95
|
+
barcodeFindViewContainer,
|
|
96
|
+
ViewGroup.LayoutParams(
|
|
97
|
+
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
98
|
+
ViewGroup.LayoutParams.MATCH_PARENT
|
|
99
|
+
)
|
|
100
|
+
)
|
|
101
|
+
render()
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private fun removeBarcodeFindViewContainer(barcodeFindViewContainer: FrameLayout) {
|
|
106
|
+
barcodeFindViewContainerReference = null
|
|
107
|
+
removeView(barcodeFindViewContainer) {
|
|
108
|
+
(barcodeFindViewContainer.children.firstOrNull() as? BarcodeFindView)?.setListener(null)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private fun removeView(view: View, uiBlock: (() -> Unit)? = null) {
|
|
113
|
+
mainThread.runOnMainThread {
|
|
114
|
+
view.removeFromParent()
|
|
115
|
+
uiBlock?.invoke()
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Update the view visibility, position and size.
|
|
120
|
+
fun render() {
|
|
121
|
+
val view = barcodeFindViewContainer ?: return
|
|
122
|
+
renderNoAnimate(view)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private fun renderNoAnimate(barcodeFindViewContainer: FrameLayout) {
|
|
126
|
+
barcodeFindViewContainer.post {
|
|
127
|
+
barcodeFindViewContainer.visibility = if (isVisible) View.VISIBLE else View.GONE
|
|
128
|
+
barcodeFindViewContainer.x = latestInfo.left.pxFromDp()
|
|
129
|
+
barcodeFindViewContainer.y = latestInfo.top.pxFromDp()
|
|
130
|
+
barcodeFindViewContainer.layoutParams.apply {
|
|
131
|
+
width = ViewGroup.LayoutParams.MATCH_PARENT
|
|
132
|
+
height = ViewGroup.LayoutParams.MATCH_PARENT
|
|
133
|
+
}
|
|
134
|
+
if (latestInfo.shouldBeUnderWebView) {
|
|
135
|
+
webView?.bringToFront()
|
|
136
|
+
(webView?.parent as View).translationZ = 1F
|
|
137
|
+
} else {
|
|
138
|
+
barcodeFindViewContainer.bringToFront()
|
|
139
|
+
(webView?.parent as View).translationZ = -1F
|
|
140
|
+
}
|
|
141
|
+
barcodeFindViewContainer.requestLayout()
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|