scandit-capacitor-datacapture-barcode 6.20.1 → 6.21.0-beta.3

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.
Files changed (142) hide show
  1. package/ScanditCapacitorDatacaptureBarcode.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ScanditBarcodeNative.kt +232 -10
  4. package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/count/BarcodeCountViewHandler.kt +14 -7
  5. package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/find/BarcodeFindViewHandler.kt +144 -0
  6. package/dist/barcode.js +4135 -0
  7. package/dist/barcode.js.map +1 -0
  8. package/dist/dts/definitions.d.ts +125 -0
  9. package/dist/dts/ts/BarcodeCountView.d.ts +173 -0
  10. package/dist/dts/ts/BarcodeTrackingAdvancedOverlay.d.ts +19 -0
  11. package/dist/dts/ts/BarcodeTrackingAdvancedOverlayListener.d.ts +10 -0
  12. package/dist/dts/ts/Capacitor/BarcodeCaptureListenerProxy.d.ts +18 -0
  13. package/dist/dts/ts/Capacitor/BarcodeCountListenerProxy.d.ts +18 -0
  14. package/dist/dts/ts/Capacitor/BarcodeCountSessionProxy.d.ts +6 -0
  15. package/dist/dts/ts/Capacitor/BarcodeCountViewProxy.d.ts +29 -0
  16. package/dist/dts/ts/Capacitor/BarcodeSelectionListenerProxy.d.ts +16 -0
  17. package/dist/dts/ts/Capacitor/BarcodeSelectionOverlayProxy.d.ts +15 -0
  18. package/dist/dts/ts/Capacitor/BarcodeSelectionProxy.d.ts +11 -0
  19. package/dist/dts/ts/Capacitor/BarcodeTrackingAdvancedOverlayProxy.d.ts +22 -0
  20. package/dist/dts/ts/Capacitor/BarcodeTrackingBasicOverlayProxy.d.ts +13 -0
  21. package/dist/dts/ts/Capacitor/BarcodeTrackingListenerProxy.d.ts +13 -0
  22. package/dist/{esm/scandit-capacitor-datacapture-barcode/src → dts}/ts/Capacitor/Capacitor.d.ts +10 -4
  23. package/dist/dts/ts/Capacitor/initBarcodeProxy.d.ts +1 -0
  24. package/dist/dts/ts/TrackedBarcodeView.d.ts +24 -0
  25. package/dist/{esm/scandit-capacitor-datacapture-barcode/src → dts}/web.d.ts +2 -1
  26. package/dist/index.js +2340 -0
  27. package/dist/index.js.map +1 -0
  28. package/ios/Plugin/CommandJSONArgument+ScanditBarcodeCapture.swift +3 -3
  29. package/ios/Plugin/Plugin.m +61 -50
  30. package/ios/Plugin/ScanditBarcodeCapture.swift +74 -8
  31. package/package.json +14 -10
  32. package/dist/esm/scandit-capacitor-datacapture-barcode/src/definitions.d.ts +0 -2063
  33. package/dist/esm/scandit-capacitor-datacapture-barcode/src/definitions.js +0 -2
  34. package/dist/esm/scandit-capacitor-datacapture-barcode/src/definitions.js.map +0 -1
  35. package/dist/esm/scandit-capacitor-datacapture-barcode/src/index.js +0 -3
  36. package/dist/esm/scandit-capacitor-datacapture-barcode/src/index.js.map +0 -1
  37. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Barcode.js +0 -274
  38. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Barcode.js.map +0 -1
  39. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCapture+Related.js +0 -120
  40. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCapture+Related.js.map +0 -1
  41. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCapture.js +0 -103
  42. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCapture.js.map +0 -1
  43. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCaptureSettings.js +0 -58
  44. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCaptureSettings.js.map +0 -1
  45. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCount+Related.js +0 -69
  46. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCount+Related.js.map +0 -1
  47. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCount.js +0 -134
  48. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCount.js.map +0 -1
  49. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountCaptureList.js +0 -57
  50. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountCaptureList.js.map +0 -1
  51. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountSettings.js +0 -54
  52. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountSettings.js.map +0 -1
  53. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountView+Related.js +0 -31
  54. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountView+Related.js.map +0 -1
  55. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountView.js +0 -645
  56. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeCountView.js.map +0 -1
  57. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeFilterSettings.js +0 -103
  58. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeFilterSettings.js.map +0 -1
  59. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelection+Related.js +0 -280
  60. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelection+Related.js.map +0 -1
  61. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelection.js +0 -121
  62. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelection.js.map +0 -1
  63. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelectionSettings.js +0 -47
  64. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeSelectionSettings.js.map +0 -1
  65. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTracking+Related.js +0 -205
  66. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTracking+Related.js.map +0 -1
  67. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTracking.js +0 -84
  68. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTracking.js.map +0 -1
  69. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTrackingSettings.js +0 -45
  70. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/BarcodeTrackingSettings.js.map +0 -1
  71. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCaptureListenerProxy.js +0 -83
  72. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCaptureListenerProxy.js.map +0 -1
  73. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountDefaults.d.ts +0 -146
  74. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountDefaults.js +0 -38
  75. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountDefaults.js.map +0 -1
  76. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountListenerProxy.js +0 -89
  77. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountListenerProxy.js.map +0 -1
  78. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountViewProxy.js +0 -242
  79. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeCountViewProxy.js.map +0 -1
  80. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeSelectionListenerProxy.js +0 -79
  81. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeSelectionListenerProxy.js.map +0 -1
  82. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeSelectionProxy.js +0 -15
  83. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeSelectionProxy.js.map +0 -1
  84. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingAdvancedOverlayProxy.js +0 -112
  85. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingAdvancedOverlayProxy.js.map +0 -1
  86. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingBasicOverlayProxy.js +0 -67
  87. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingBasicOverlayProxy.js.map +0 -1
  88. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingListenerProxy.js +0 -54
  89. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/BarcodeTrackingListenerProxy.js.map +0 -1
  90. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Capacitor.js +0 -65
  91. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Capacitor.js.map +0 -1
  92. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Defaults.d.ts +0 -115
  93. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Defaults.js +0 -145
  94. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/Capacitor/Defaults.js.map +0 -1
  95. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/TrackedBarcodeView.js +0 -62
  96. package/dist/esm/scandit-capacitor-datacapture-barcode/src/ts/TrackedBarcodeView.js.map +0 -1
  97. package/dist/esm/scandit-capacitor-datacapture-barcode/src/web.js +0 -103
  98. package/dist/esm/scandit-capacitor-datacapture-barcode/src/web.js.map +0 -1
  99. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Camera+Related.js +0 -163
  100. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Camera+Related.js.map +0 -1
  101. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Camera.js +0 -122
  102. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Camera.js.map +0 -1
  103. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CameraProxy.js +0 -35
  104. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CameraProxy.js.map +0 -1
  105. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Capacitor.d.ts +0 -34
  106. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Capacitor.js +0 -54
  107. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Capacitor.js.map +0 -1
  108. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor.d.ts +0 -11
  109. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor.js +0 -61
  110. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor.js.map +0 -1
  111. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/DataCaptureContextProxy.js +0 -69
  112. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/DataCaptureContextProxy.js.map +0 -1
  113. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/DataCaptureViewProxy.js +0 -73
  114. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/DataCaptureViewProxy.js.map +0 -1
  115. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Defaults.d.ts +0 -169
  116. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Defaults.js +0 -79
  117. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/Defaults.js.map +0 -1
  118. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/FeedbackProxy.js +0 -12
  119. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Capacitor/FeedbackProxy.js.map +0 -1
  120. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Common.js +0 -467
  121. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Common.js.map +0 -1
  122. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureContext+Related.js +0 -19
  123. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureContext+Related.js.map +0 -1
  124. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureContext.js +0 -136
  125. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureContext.js.map +0 -1
  126. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureView+Related.js +0 -39
  127. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureView+Related.js.map +0 -1
  128. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureView.js +0 -352
  129. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/DataCaptureView.js.map +0 -1
  130. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Feedback.js +0 -94
  131. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Feedback.js.map +0 -1
  132. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/LocationSelection.js +0 -53
  133. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/LocationSelection.js.map +0 -1
  134. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Serializeable.js +0 -67
  135. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Serializeable.js.map +0 -1
  136. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Viewfinder+Related.js +0 -43
  137. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Viewfinder+Related.js.map +0 -1
  138. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Viewfinder.js +0 -133
  139. package/dist/esm/scandit-capacitor-datacapture-core/src/ts/Viewfinder.js.map +0 -1
  140. package/dist/plugin.js +0 -5050
  141. package/dist/plugin.js.map +0 -1
  142. /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.1'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 6.21.0-beta.3'
21
21
  end
@@ -56,7 +56,7 @@ repositories {
56
56
  }
57
57
 
58
58
  dependencies {
59
- def sdk_version = "6.20.1"
59
+ def sdk_version = "6.21.0-beta.3"
60
60
 
61
61
  implementation fileTree(dir: 'libs', include: ['*.jar'])
62
62
  implementation fileTree(dir: 'library', include: ['*.aar'])
@@ -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
- FrameworksLog.error("Core not found")
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
- mapOf("BarcodeCapture" to barcodeCaptureModule.getDefaults()) +
157
- mapOf("BarcodeTracking" to barcodeTrackingModule.getDefaults()) +
158
- mapOf("BarcodeSelection" to barcodeSelectionModule.getDefaults()) +
159
- mapOf("BarcodeCount" to barcodeCountModule.getDefaults())
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,30 +191,60 @@ 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()
176
203
  call.resolve()
177
204
  }
178
205
 
206
+ @PluginMethod
207
+ fun unsubscribeBarcodeTrackingListener(call: PluginCall) {
208
+ barcodeTrackingModule.removeBarcodeTrackingListener()
209
+ call.resolve()
210
+ }
211
+
179
212
  @PluginMethod
180
213
  fun finishBarcodeTrackingDidUpdateSession(call: PluginCall) {
181
214
  barcodeTrackingModule.finishDidUpdateSession(call.data.getBoolean("enabled"))
182
215
  call.resolve()
183
216
  }
184
217
 
218
+ @PluginMethod
219
+ fun setBarcodeTrackingModeEnabledState(call: PluginCall) {
220
+ barcodeTrackingModule.setModeEnabled(call.data.getBoolean("enabled"))
221
+ call.resolve()
222
+ }
223
+
185
224
  @PluginMethod
186
225
  fun subscribeBarcodeTrackingBasicOverlayListener(call: PluginCall) {
187
226
  barcodeTrackingModule.addBasicOverlayListener()
188
227
  call.resolve()
189
228
  }
190
229
 
230
+ @PluginMethod
231
+ fun unsubscribeBarcodeTrackingBasicOverlayListener(call: PluginCall) {
232
+ barcodeTrackingModule.removeBasicOverlayListener()
233
+ call.resolve()
234
+ }
235
+
191
236
  @PluginMethod
192
237
  fun subscribeBarcodeSelectionListener(call: PluginCall) {
193
238
  barcodeSelectionModule.addListener()
194
239
  call.resolve()
195
240
  }
196
241
 
242
+ @PluginMethod
243
+ fun unsubscribeBarcodeSelectionListener(call: PluginCall) {
244
+ barcodeSelectionModule.removeListener()
245
+ call.resolve()
246
+ }
247
+
197
248
  @PluginMethod
198
249
  fun clearTrackedBarcodeBrushes(call: PluginCall) {
199
250
  barcodeTrackingModule.clearBasicOverlayTrackedBarcodeBrushes()
@@ -218,15 +269,21 @@ class ScanditBarcodeNative :
218
269
  call.resolve()
219
270
  }
220
271
 
272
+ @PluginMethod
273
+ fun unsubscribeBarcodeTrackingAdvancedOverlayListener(call: PluginCall) {
274
+ barcodeTrackingModule.removeAdvancedOverlayListener()
275
+ call.resolve()
276
+ }
277
+
221
278
  @PluginMethod
222
279
  fun setViewForTrackedBarcode(call: PluginCall) {
223
280
  try {
224
- WorkerThread.runOnBackgroundThread {
281
+ workerThread.runOnBackgroundThread {
225
282
  val serializationData = SerializableAdvancedOverlayViewData(call.data)
226
283
 
227
284
  val image = getBitmapFromBase64EncodedViewData(serializationData.view?.data)
228
285
 
229
- MainThread.runOnMainThread {
286
+ mainThread.runOnMainThread {
230
287
  val view = barcodeTrackingModule.getTrackedBarcodeViewFromBitmap(
231
288
  serializationData.trackedBarcodeId,
232
289
  image
@@ -327,6 +384,18 @@ class ScanditBarcodeNative :
327
384
  call.resolve()
328
385
  }
329
386
 
387
+ @PluginMethod
388
+ fun finishBarcodeSelectionDidSelect(call: PluginCall) {
389
+ barcodeSelectionModule.finishDidSelect(call.data.getBoolean("enabled"))
390
+ call.resolve()
391
+ }
392
+
393
+ @PluginMethod
394
+ fun finishBarcodeSelectionDidUpdateSession(call: PluginCall) {
395
+ barcodeSelectionModule.finishDidUpdateSession(call.data.getBoolean("enabled"))
396
+ call.resolve()
397
+ }
398
+
330
399
  private fun onFinishBarcodeSelectionDidUpdateSession(
331
400
  finishData: SerializableFinishModeCallbackData?
332
401
  ) {
@@ -356,6 +425,12 @@ class ScanditBarcodeNative :
356
425
  call.resolve()
357
426
  }
358
427
 
428
+ @PluginMethod
429
+ fun setBarcodeSelectionModeEnabledState(call: PluginCall) {
430
+ barcodeSelectionModule.setModeEnabled(call.data.getBoolean("enabled"))
431
+ call.resolve()
432
+ }
433
+
359
434
  //region BarcodeCount
360
435
 
361
436
  //region Barcode Count Listener
@@ -500,6 +575,28 @@ class ScanditBarcodeNative :
500
575
  call.resolve()
501
576
  }
502
577
 
578
+ @PluginMethod
579
+ fun getSpatialMap(call: PluginCall) {
580
+ val map = barcodeCountModule.getSpatialMap()
581
+ call.resolve(JSObject.fromJSONObject(JSONObject(map?.toJson() ?: "{}")))
582
+ }
583
+
584
+ @PluginMethod
585
+ fun getSpatialMapWithHints(call: PluginCall) {
586
+ val expectedNumberOfRows = call.data.getInteger("expectedNumberOfRows")
587
+ ?: return call.reject("No expectedNumberOfRows was provided for the function.")
588
+ val expectedNumberOfColumns = call.data.getInteger("expectedNumberOfColumns")
589
+ ?: return call.reject("No expectedNumberOfColumns was provided for the function.")
590
+ val map = barcodeCountModule.getSpatialMap(expectedNumberOfRows, expectedNumberOfColumns)
591
+ call.resolve(JSObject.fromJSONObject(JSONObject(map?.toJson() ?: "{}")))
592
+ }
593
+
594
+ @PluginMethod
595
+ fun setBarcodeCountModeEnabledState(call: PluginCall) {
596
+ barcodeCountModule.setModeEnabled(call.data.getBoolean("enabled"))
597
+ call.resolve()
598
+ }
599
+
503
600
  //endregion
504
601
 
505
602
  @PluginMethod
@@ -566,6 +663,131 @@ class ScanditBarcodeNative :
566
663
 
567
664
  private fun checkFinishCallbackIdFieldForValue(data: JSONObject, value: String): Boolean {
568
665
  return data.has(SerializableCallbackAction.FIELD_FINISH_CALLBACK_ID) &&
569
- data[SerializableCallbackAction.FIELD_FINISH_CALLBACK_ID] == value
666
+ data[SerializableCallbackAction.FIELD_FINISH_CALLBACK_ID] == value
570
667
  }
668
+
669
+
670
+ //region Barcode Find
671
+
672
+ @PluginMethod
673
+ fun createFindView(
674
+ call: PluginCall
675
+ ) {
676
+ val viewJson = call.data.toString()
677
+ val container = barcodeFindViewHandler.prepareContainer(this.context)
678
+
679
+ val result = barcodeFindModule.getView(container, viewJson)
680
+ if (result.isFailure) {
681
+ call.reject(
682
+ result.exceptionOrNull()?.message
683
+ ?: "Unable to create the BarcodeFindView from the given json=$viewJson"
684
+ )
685
+ return
686
+ }
687
+
688
+ barcodeFindViewHandler.addBarcodeFindViewContainer(container, bridge.activity)
689
+ barcodeCountViewHandler.render()
690
+ call.resolve()
691
+ }
692
+
693
+ @PluginMethod
694
+ fun updateFindView(call: PluginCall) {
695
+ barcodeFindModule.updateBarcodeFindView(
696
+ call.data["BarcodeFindView"].toString(),
697
+ CapacitorResult(call)
698
+ )
699
+ }
700
+
701
+ @PluginMethod
702
+ fun updateFindMode(call: PluginCall) {
703
+ barcodeFindModule.updateBarcodeFindMode(
704
+ call.data["BarcodeFind"].toString(),
705
+ CapacitorResult(call)
706
+ )
707
+ }
708
+
709
+ @PluginMethod
710
+ fun registerBarcodeFindListener(call: PluginCall) {
711
+ barcodeFindModule.addBarcodeFindListener(CapacitorResult(call))
712
+ }
713
+
714
+ @PluginMethod
715
+ fun unregisterBarcodeFindListener(call: PluginCall) {
716
+ barcodeFindModule.removeBarcodeFindListener(CapacitorResult(call))
717
+ }
718
+
719
+ @PluginMethod
720
+ fun registerBarcodeFindViewListener(call: PluginCall) {
721
+ barcodeFindModule.addBarcodeFindViewListener(CapacitorResult(call))
722
+ }
723
+
724
+ @PluginMethod
725
+ fun unregisterBarcodeFindViewListener(call: PluginCall) {
726
+ barcodeFindModule.removeBarcodeFindViewListener(CapacitorResult(call))
727
+ }
728
+
729
+ @PluginMethod
730
+ fun barcodeFindViewOnPause(call: PluginCall) {
731
+ barcodeFindModule.viewOnPause(CapacitorResult(call))
732
+ }
733
+
734
+ @PluginMethod
735
+ fun barcodeFindViewOnResume(call: PluginCall) {
736
+ barcodeFindModule.viewOnResume(CapacitorResult(call))
737
+ }
738
+
739
+ @PluginMethod
740
+ fun barcodeFindSetItemList(barcodeFindItemsJson: String, call: PluginCall) {
741
+ barcodeFindModule.setItemList(barcodeFindItemsJson, CapacitorResult(call))
742
+ }
743
+
744
+ @PluginMethod
745
+ fun barcodeFindViewStopSearching(call: PluginCall) {
746
+ barcodeFindModule.viewStopSearching(CapacitorResult(call))
747
+ }
748
+
749
+ @PluginMethod
750
+ fun barcodeFindViewStartSearching(call: PluginCall) {
751
+ barcodeFindModule.viewStartSearching(CapacitorResult(call))
752
+ }
753
+
754
+ @PluginMethod
755
+ fun barcodeFindViewPauseSearching(call: PluginCall) {
756
+ barcodeFindModule.viewPauseSearching(CapacitorResult(call))
757
+ }
758
+
759
+ @PluginMethod
760
+ fun barcodeFindModeStart(call: PluginCall) {
761
+ barcodeFindModule.modeStart(CapacitorResult(call))
762
+ }
763
+
764
+ @PluginMethod
765
+ fun barcodeFindModePause(call: PluginCall) {
766
+ barcodeFindModule.modePause(CapacitorResult(call))
767
+ }
768
+
769
+ @PluginMethod
770
+ fun barcodeFindModeStop(call: PluginCall) {
771
+ barcodeFindModule.modeStop(CapacitorResult(call))
772
+ }
773
+
774
+ @PluginMethod
775
+ fun showFindView(call: PluginCall) {
776
+ barcodeFindViewHandler.setVisible()
777
+ call.resolve()
778
+ }
779
+
780
+ @PluginMethod
781
+ fun hideFindView(call: PluginCall) {
782
+ barcodeFindViewHandler.setInvisible()
783
+ call.resolve()
784
+ }
785
+
786
+ @PluginMethod
787
+ fun setBarcodeFindModeEnabledState(call: PluginCall) {
788
+ barcodeFindModule.setModeEnabled(call.data.getBoolean("enabled"))
789
+ call.resolve()
790
+ }
791
+
792
+ //endregion
571
793
  }
@@ -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
- MainThread.runOnMainThread {
37
- webView.bringToFront()
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
- MainThread.runOnMainThread {
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
- MainThread.runOnMainThread {
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
+ }