scandit-capacitor-datacapture-core 7.6.0-beta.1 → 7.6.0

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.
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
16
16
  s.swift_version = "5.7"
17
17
 
18
18
  s.dependency "Capacitor"
19
- s.dependency "scandit-datacapture-frameworks-core", '= 7.6.0-beta.1'
19
+ s.dependency "scandit-datacapture-frameworks-core", '= 7.6.0'
20
20
  end
@@ -83,7 +83,7 @@ repositories {
83
83
  }
84
84
 
85
85
  dependencies {
86
- def sdk_version = "7.6.0-beta.1"
86
+ def sdk_version = "7.6.0"
87
87
 
88
88
  implementation fileTree(dir: 'libs', include: ['*.jar'])
89
89
 
@@ -355,7 +355,9 @@ class ScanditCaptureCoreNative :
355
355
  captureViewHandler.removeDataCaptureView(existingView)
356
356
  }
357
357
 
358
- captureViewHandler.addDataCaptureView(view, this.activity)
358
+ activity.runOnUiThread {
359
+ captureViewHandler.addDataCaptureView(view, this.activity)
360
+ }
359
361
  }
360
362
  }
361
363
 
package/dist/core.js CHANGED
@@ -2238,46 +2238,45 @@ class DataCaptureContext extends DefaultSerializeable {
2238
2238
  this.controller.unsubscribeListener();
2239
2239
  }
2240
2240
  }
2241
- /**
2242
- * @deprecated Since 7.6.
2243
- * Use setMode() instead. DataCaptureContext does not support multiple modes at the same time.
2244
- */
2245
2241
  addMode(mode) {
2246
2242
  this.addModeInternal(mode);
2247
2243
  }
2248
2244
  setMode(mode) {
2249
- if (this.modes.length > 0) {
2250
- this.removeAllModes();
2251
- }
2245
+ this.removeAllModes();
2252
2246
  this.addModeInternal(mode);
2253
2247
  }
2254
2248
  addModeInternal(mode) {
2255
2249
  if (!this.modes.includes(mode)) {
2256
2250
  this.modes.push(mode);
2257
- mode._context = this;
2258
2251
  this.controller.addModeToContext(mode);
2252
+ mode._context = this;
2259
2253
  }
2260
2254
  }
2261
2255
  removeCurrentMode() {
2262
- if (this.modes.length > 0) {
2263
- this.removeModeInternal(this.modes[0]);
2256
+ if (this.modes.length === 0) {
2257
+ return;
2264
2258
  }
2259
+ if (this.modes.length > 1) {
2260
+ console.warn('removeCurrentMode() called with multiple modes active. Consider using removeMode() for specific mode removal. Only the first mode will be removed.');
2261
+ }
2262
+ this.removeModeInternal(this.modes[0]);
2265
2263
  }
2266
- /**
2267
- * @deprecated Since 7.6.
2268
- * Use removeCurrentMode() instead.
2269
- */
2270
2264
  removeMode(mode) {
2271
2265
  this.removeModeInternal(mode);
2272
2266
  }
2273
2267
  removeModeInternal(mode) {
2274
- if (this.modes.includes(mode)) {
2275
- this.modes.splice(this.modes.indexOf(mode), 1);
2276
- mode._context = null;
2277
- this.controller.removeModeFromContext(mode);
2278
- }
2268
+ return __awaiter(this, void 0, void 0, function* () {
2269
+ if (this.modes.includes(mode)) {
2270
+ this.modes.splice(this.modes.indexOf(mode), 1);
2271
+ mode._context = null;
2272
+ this.controller.removeModeFromContext(mode);
2273
+ }
2274
+ });
2279
2275
  }
2280
2276
  removeAllModes() {
2277
+ if (this.modes.length === 0) {
2278
+ return;
2279
+ }
2281
2280
  this.modes.forEach(mode => {
2282
2281
  mode._context = null;
2283
2282
  });