scandit-capacitor-datacapture-barcode 7.0.0 → 7.0.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.
@@ -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", '= 7.0.0'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 7.0.1'
21
21
  end
@@ -56,7 +56,7 @@ repositories {
56
56
  }
57
57
 
58
58
  dependencies {
59
- def sdk_version = "7.0.0"
59
+ def sdk_version = "7.0.1"
60
60
 
61
61
  implementation fileTree(dir: 'libs', include: ['*.jar'])
62
62
  implementation fileTree(dir: 'library', include: ['*.aar'])
@@ -912,6 +912,13 @@ class ScanditBarcodeNative :
912
912
  )
913
913
  }
914
914
 
915
+ @PluginMethod
916
+ fun removeFindView(call: PluginCall) {
917
+ barcodeFindModule.viewDisposed()
918
+ barcodeFindViewHandler.disposeCurrentView()
919
+ call.resolve()
920
+ }
921
+
915
922
  @PluginMethod
916
923
  fun updateFindMode(call: PluginCall) {
917
924
  barcodeFindModule.updateBarcodeFindMode(
@@ -75,7 +75,7 @@ class BarcodeFindViewHandler(
75
75
  disposeCurrentWebView()
76
76
  }
77
77
 
78
- private fun disposeCurrentView() {
78
+ fun disposeCurrentView() {
79
79
  val view = barcodeFindViewContainer ?: return
80
80
  removeView(view)
81
81
  }
package/dist/barcode.js CHANGED
@@ -3664,7 +3664,7 @@ __decorate([
3664
3664
  nameForSerialization('scanningBehavior')
3665
3665
  ], PrivateSparkScanScanningModeSettings.prototype, "_scanningBehavior", void 0);
3666
3666
  __decorate([
3667
- nameForSerialization('scanningBehavior')
3667
+ nameForSerialization('previewBehavior')
3668
3668
  ], PrivateSparkScanScanningModeSettings.prototype, "_previewBehavior", void 0);
3669
3669
 
3670
3670
  class SparkScanScanningModeDefault extends DefaultSerializeable {
@@ -3844,24 +3844,26 @@ var SparkScanFeedbackDelegateEvents;
3844
3844
  SparkScanFeedbackDelegateEvents["feedbackForBarcode"] = "SparkScanFeedbackDelegate.feedbackForBarcode";
3845
3845
  })(SparkScanFeedbackDelegateEvents || (SparkScanFeedbackDelegateEvents = {}));
3846
3846
  class SparkScanViewController extends BaseController {
3847
- static forSparkScanView(view, sparkScan) {
3847
+ static forSparkScanView(view, sparkScan, autoCreateNativeView = true) {
3848
3848
  const controller = new SparkScanViewController();
3849
3849
  controller.view = view;
3850
3850
  controller.sparkScan = sparkScan;
3851
3851
  // We call update because it returns a promise, this guarantees, that by the time
3852
3852
  // we need the deserialized context, it will be set in the native layer.
3853
- controller.initialize();
3853
+ controller.initialize(autoCreateNativeView);
3854
3854
  return controller;
3855
3855
  }
3856
3856
  constructor() {
3857
3857
  super('SparkScanViewProxy');
3858
3858
  this.hasFeedbackDelegateListener = false;
3859
3859
  }
3860
- initialize() {
3860
+ initialize(autoCreateNativeView) {
3861
3861
  return __awaiter(this, void 0, void 0, function* () {
3862
3862
  this.subscribeListeners();
3863
3863
  yield this.view.context.update();
3864
- yield this.create();
3864
+ if (autoCreateNativeView) {
3865
+ yield this.create();
3866
+ }
3865
3867
  this._proxy.prepareSparkScanViewScanning();
3866
3868
  });
3867
3869
  }
@@ -3950,14 +3952,14 @@ class SparkScanViewController extends BaseController {
3950
3952
  }
3951
3953
 
3952
3954
  class BaseSparkScanView {
3953
- static forContext(context, sparkScan, settings) {
3954
- const view = new BaseSparkScanView({ context, sparkScan, settings });
3955
+ static forContext(context, sparkScan, settings, autoCreateNativeView = true) {
3956
+ const view = new BaseSparkScanView({ context, sparkScan, settings, autoCreateNativeView });
3955
3957
  return view;
3956
3958
  }
3957
3959
  static get defaultBrush() {
3958
3960
  return BaseSparkScanView.sparkScanDefaults.SparkScanView.brush;
3959
3961
  }
3960
- constructor({ context, sparkScan, settings }) {
3962
+ constructor({ context, sparkScan, settings, autoCreateNativeView }) {
3961
3963
  this.uiListener = null;
3962
3964
  this._brush = BaseSparkScanView.defaultBrush;
3963
3965
  this._feedbackDelegate = null;
@@ -3982,7 +3984,7 @@ class BaseSparkScanView {
3982
3984
  this._sparkScan = sparkScan;
3983
3985
  this.context = context;
3984
3986
  this._viewSettings = settings !== null && settings !== void 0 ? settings : new SparkScanViewSettings();
3985
- this._controller = SparkScanViewController.forSparkScanView(this, sparkScan);
3987
+ this._controller = SparkScanViewController.forSparkScanView(this, sparkScan, autoCreateNativeView);
3986
3988
  }
3987
3989
  get previewSizeControlVisible() {
3988
3990
  return this._previewSizeControlVisible;
@@ -5817,12 +5819,14 @@ var BarcodeFindViewEvents;
5817
5819
  class BarcodeFindViewController extends BaseController {
5818
5820
  constructor() {
5819
5821
  super('BarcodeFindViewProxy');
5822
+ this.autoCreateNativeView = true;
5820
5823
  this.isListenerEnabled = false;
5821
5824
  }
5822
- static forBarcodeFindView(baseView, nativeView) {
5825
+ static forBarcodeFindView(baseView, nativeView, autoCreateNativeView = true) {
5823
5826
  const viewController = new BarcodeFindViewController();
5824
5827
  viewController.baseView = baseView;
5825
5828
  viewController.nativeView = nativeView;
5829
+ viewController.autoCreateNativeView = autoCreateNativeView;
5826
5830
  viewController.initialize();
5827
5831
  return viewController;
5828
5832
  }
@@ -5863,16 +5867,25 @@ class BarcodeFindViewController extends BaseController {
5863
5867
  hideView() {
5864
5868
  return this._proxy.hideView();
5865
5869
  }
5870
+ createNativeView() {
5871
+ return this.create();
5872
+ }
5873
+ removeNativeView() {
5874
+ var _a, _b, _c;
5875
+ return (_c = (_b = (_a = this._proxy).removeView) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : Promise.resolve();
5876
+ }
5866
5877
  create() {
5867
- const barcodePickView = this.baseView.toJSON();
5868
- const json = JSON.stringify(barcodePickView);
5878
+ const barcodeFindView = this.baseView.toJSON();
5879
+ const json = JSON.stringify(barcodeFindView);
5869
5880
  const id = this._proxy.findNodeHandle(this.nativeView);
5870
5881
  return this._proxy.createView(id, json);
5871
5882
  }
5872
5883
  initialize() {
5873
5884
  return __awaiter(this, void 0, void 0, function* () {
5874
5885
  yield this.baseView.context.update();
5875
- yield this.create();
5886
+ if (this.autoCreateNativeView) {
5887
+ yield this.create();
5888
+ }
5876
5889
  });
5877
5890
  }
5878
5891
  subscribeToEvents() {
@@ -5894,6 +5907,9 @@ class BarcodeFindViewController extends BaseController {
5894
5907
  this.unsubscribeToEvents();
5895
5908
  }
5896
5909
  }
5910
+ __decorate([
5911
+ ignoreFromSerialization
5912
+ ], BarcodeFindViewController.prototype, "autoCreateNativeView", void 0);
5897
5913
 
5898
5914
  class BaseBarcodeFindView {
5899
5915
  get barcodeFindViewUiListener() {
@@ -5906,7 +5922,9 @@ class BaseBarcodeFindView {
5906
5922
  get context() {
5907
5923
  return this._dataCaptureContext;
5908
5924
  }
5909
- constructor(context, barcodeFind, barcodeFindViewSettings, cameraSettings) {
5925
+ constructor(context, barcodeFind, barcodeFindViewSettings, cameraSettings, autoCreateNativeView = true) {
5926
+ this.isViewCreated = false;
5927
+ this.autoCreateNativeView = true;
5910
5928
  this._startSearching = false;
5911
5929
  this._isInitialized = false;
5912
5930
  this._barcodeFindViewUiListener = null;
@@ -5914,9 +5932,11 @@ class BaseBarcodeFindView {
5914
5932
  this._barcodeFind = barcodeFind;
5915
5933
  this._barcodeFindViewSettings = barcodeFindViewSettings;
5916
5934
  this._cameraSettings = cameraSettings;
5935
+ this.isViewCreated = autoCreateNativeView;
5936
+ this.autoCreateNativeView = autoCreateNativeView;
5917
5937
  }
5918
5938
  initialize(nativeView) {
5919
- this.controller = BarcodeFindViewController.forBarcodeFindView(this, nativeView);
5939
+ this.controller = BarcodeFindViewController.forBarcodeFindView(this, nativeView, this.autoCreateNativeView);
5920
5940
  this._isInitialized = true;
5921
5941
  }
5922
5942
  static forMode(dataCaptureContext, barcodeFind) {
@@ -5955,6 +5975,21 @@ class BaseBarcodeFindView {
5955
5975
  hide() {
5956
5976
  return this.controller.hideView();
5957
5977
  }
5978
+ createNativeView() {
5979
+ return __awaiter(this, void 0, void 0, function* () {
5980
+ if (this.isViewCreated) {
5981
+ return Promise.resolve();
5982
+ }
5983
+ yield this.controller.createNativeView();
5984
+ this.isViewCreated = true;
5985
+ });
5986
+ }
5987
+ removeNativeView() {
5988
+ return __awaiter(this, void 0, void 0, function* () {
5989
+ yield this.controller.removeNativeView();
5990
+ this.isViewCreated = false;
5991
+ });
5992
+ }
5958
5993
  get shouldShowUserGuidanceView() {
5959
5994
  return BaseBarcodeFindView.barcodeFindViewDefaults.shouldShowUserGuidanceView;
5960
5995
  }
@@ -6076,6 +6111,7 @@ class BaseBarcodeFindView {
6076
6111
  dispose() {
6077
6112
  this.controller.dispose();
6078
6113
  this._barcodeFind.unsubscribeNativeListeners();
6114
+ this.isViewCreated = false;
6079
6115
  }
6080
6116
  toJSON() {
6081
6117
  var _a, _b, _c;
@@ -6112,6 +6148,12 @@ class BaseBarcodeFindView {
6112
6148
  return json;
6113
6149
  }
6114
6150
  }
6151
+ __decorate([
6152
+ ignoreFromSerialization
6153
+ ], BaseBarcodeFindView.prototype, "isViewCreated", void 0);
6154
+ __decorate([
6155
+ ignoreFromSerialization
6156
+ ], BaseBarcodeFindView.prototype, "autoCreateNativeView", void 0);
6115
6157
 
6116
6158
  class BarcodeGeneratorCreationOptions {
6117
6159
  constructor(backgroundColor = null, foregroundColor = null, errorCorrectionLevel = null, versionNumber = null, minimumErrorCorrectionPercent = null, layers = null) {