scandit-capacitor-datacapture-barcode 6.22.1 → 6.23.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.
@@ -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.22.1'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 6.23.0-beta.2'
21
21
  end
@@ -56,7 +56,7 @@ repositories {
56
56
  }
57
57
 
58
58
  dependencies {
59
- def sdk_version = "6.22.1"
59
+ def sdk_version = "6.23.0-beta.2"
60
60
 
61
61
  implementation fileTree(dir: 'libs', include: ['*.jar'])
62
62
  implementation fileTree(dir: 'library', include: ['*.aar'])
@@ -40,12 +40,14 @@ import com.scandit.datacapture.frameworks.barcode.count.listeners.FrameworksBarc
40
40
  import com.scandit.datacapture.frameworks.barcode.find.BarcodeFindModule
41
41
  import com.scandit.datacapture.frameworks.barcode.find.listeners.FrameworksBarcodeFindListener
42
42
  import com.scandit.datacapture.frameworks.barcode.find.listeners.FrameworksBarcodeFindViewUiListener
43
+ import com.scandit.datacapture.frameworks.barcode.find.transformer.FrameworksBarcodeFindTransformer
43
44
  import com.scandit.datacapture.frameworks.barcode.pick.BarcodePickModule
44
45
  import com.scandit.datacapture.frameworks.barcode.selection.BarcodeSelectionModule
45
46
  import com.scandit.datacapture.frameworks.barcode.selection.listeners.FrameworksBarcodeSelectionAimedBrushProvider
46
47
  import com.scandit.datacapture.frameworks.barcode.selection.listeners.FrameworksBarcodeSelectionListener
47
48
  import com.scandit.datacapture.frameworks.barcode.selection.listeners.FrameworksBarcodeSelectionTrackedBrushProvider
48
49
  import com.scandit.datacapture.frameworks.barcode.spark.SparkScanModule
50
+ import com.scandit.datacapture.frameworks.barcode.spark.delegates.FrameworksSparkScanFeedbackDelegate
49
51
  import com.scandit.datacapture.frameworks.barcode.spark.listeners.FrameworksSparkScanListener
50
52
  import com.scandit.datacapture.frameworks.barcode.spark.listeners.FrameworksSparkScanViewUiListener
51
53
  import com.scandit.datacapture.frameworks.barcode.tracking.BarcodeTrackingModule
@@ -100,13 +102,16 @@ class ScanditBarcodeNative :
100
102
  )
101
103
  private val barcodeFindModule = BarcodeFindModule(
102
104
  FrameworksBarcodeFindListener(this),
103
- FrameworksBarcodeFindViewUiListener(this)
105
+ FrameworksBarcodeFindViewUiListener(this),
106
+ FrameworksBarcodeFindTransformer(this)
104
107
  )
105
108
  private val barcodePickModule = BarcodePickModule(
106
109
  this
107
110
  )
108
111
  private val sparkScanModule = SparkScanModule(
109
- FrameworksSparkScanListener(this), FrameworksSparkScanViewUiListener(this)
112
+ FrameworksSparkScanListener(this),
113
+ FrameworksSparkScanViewUiListener(this),
114
+ FrameworksSparkScanFeedbackDelegate(this)
110
115
  )
111
116
 
112
117
  private val barcodeCountViewHandler: BarcodeCountViewHandler = BarcodeCountViewHandler()
@@ -823,12 +828,12 @@ class ScanditBarcodeNative :
823
828
  fun createFindView(
824
829
  call: PluginCall
825
830
  ) {
826
- val viewJson = call.getObject("View")
831
+ val viewJson = call.data
827
832
 
828
- viewJson?.let {
833
+ if (viewJson.has("View")) {
829
834
  val container = barcodeFindViewHandler.prepareContainer(this.context)
830
835
 
831
- val result = barcodeFindModule.getView(container, call.data.toString())
836
+ val result = barcodeFindModule.getView(container, viewJson.toString())
832
837
  if (result.isFailure) {
833
838
  call.reject(
834
839
  result.exceptionOrNull()?.message
@@ -840,8 +845,8 @@ class ScanditBarcodeNative :
840
845
  barcodeFindViewHandler.addBarcodeFindViewContainer(container, bridge.activity)
841
846
  barcodeCountViewHandler.render()
842
847
  call.resolve()
843
- } ?: run {
844
- error("missing parameter for createFindView()")
848
+ } else {
849
+ call.reject("missing parameter for createFindView()")
845
850
  }
846
851
  }
847
852
 
@@ -1000,6 +1005,36 @@ class ScanditBarcodeNative :
1000
1005
  call.resolve()
1001
1006
  }
1002
1007
 
1008
+ @PluginMethod
1009
+ fun addScanningListener(call: PluginCall) {
1010
+ barcodePickModule.addScanningListener(CapacitorResult(call))
1011
+ }
1012
+
1013
+ @PluginMethod
1014
+ fun removeScanningListener(call: PluginCall) {
1015
+ barcodePickModule.removeScanningListener(CapacitorResult(call))
1016
+ }
1017
+
1018
+ @PluginMethod
1019
+ fun addViewListener(call: PluginCall) {
1020
+ barcodePickModule.addViewListener(CapacitorResult(call))
1021
+ }
1022
+
1023
+ @PluginMethod
1024
+ fun removeViewListener(call: PluginCall) {
1025
+ barcodePickModule.removeViewListener(CapacitorResult(call))
1026
+ }
1027
+
1028
+ @PluginMethod
1029
+ fun registerBarcodePickViewUiListener(call: PluginCall) {
1030
+ barcodePickModule.addViewUiListener(CapacitorResult(call))
1031
+ }
1032
+
1033
+ @PluginMethod
1034
+ fun unregisterBarcodePickViewUiListener(call: PluginCall) {
1035
+ barcodePickModule.removeViewUiListener(CapacitorResult(call))
1036
+ }
1037
+
1003
1038
  @PluginMethod
1004
1039
  fun finishOnProductIdentifierForItems(call: PluginCall) {
1005
1040
  val barcodePickProductProviderCallbackItemsJson =
@@ -1022,6 +1057,12 @@ class ScanditBarcodeNative :
1022
1057
  call.resolve()
1023
1058
  }
1024
1059
 
1060
+ @PluginMethod
1061
+ fun viewFreeze(call: PluginCall) {
1062
+ barcodePickModule.viewFreeze(CapacitorResult(call))
1063
+ }
1064
+
1065
+
1025
1066
  @PluginMethod
1026
1067
  fun finishPickAction(call: PluginCall) {
1027
1068
  val itemDataJson = call.getString("code")
@@ -1235,4 +1276,32 @@ class ScanditBarcodeNative :
1235
1276
  sparkScanModule.onPause()
1236
1277
  call.resolve()
1237
1278
  }
1279
+
1280
+ @PluginMethod
1281
+ fun addSparkScanFeedbackDelegate(call: PluginCall) {
1282
+ sparkScanModule.addFeedbackDelegate(CapacitorResult(call))
1283
+ }
1284
+
1285
+ @PluginMethod
1286
+ fun removeSparkScanFeedbackDelegate(call: PluginCall) {
1287
+ sparkScanModule.removeFeedbackDelegate(CapacitorResult(call))
1288
+ }
1289
+
1290
+ @PluginMethod
1291
+ fun submitSparkScanFeedbackForBarcode(call: PluginCall) {
1292
+ sparkScanModule.submitFeedbackForBarcode(
1293
+ call.data.getString("feedbackJson", null),
1294
+ CapacitorResult(call)
1295
+ )
1296
+ }
1297
+
1298
+ @PluginMethod
1299
+ fun showToast(call: PluginCall) {
1300
+ val text = call.data.getString("text")
1301
+ ?: return call.reject(WRONG_INPUT)
1302
+ sparkScanModule.showToast(
1303
+ text,
1304
+ CapacitorResult(call)
1305
+ )
1306
+ }
1238
1307
  }