scandit-capacitor-datacapture-barcode 7.0.0 → 7.0.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.
@@ -179,6 +179,7 @@ export interface ScanditBarcodeFindNativeInterface {
179
179
  updateFindView(barcodeFindViewJson: {
180
180
  BarcodeFindView: string;
181
181
  }): Promise<void>;
182
+ removeFindView(): Promise<void>;
182
183
  showFindView(): Promise<void>;
183
184
  hideFindView(): Promise<void>;
184
185
  setBarcodeTransformer(): Promise<void>;
@@ -13,6 +13,7 @@ export declare class NativeBarcodeFindViewProxy extends BaseNativeProxy implemen
13
13
  findNodeHandle(_view?: BarcodeFindView | undefined): number | null;
14
14
  createView(_id: number | null, barcodeFindViewJson: string): Promise<void>;
15
15
  updateView(barcodeFindViewJson: string): Promise<void>;
16
+ removeView(): Promise<void>;
16
17
  subscribeBarcodeFindViewListener(): Promise<void>;
17
18
  unsubscribeBarcodeFindViewListener(): Promise<void>;
18
19
  private notifyListeners;
package/dist/index.js CHANGED
@@ -1672,6 +1672,9 @@ class NativeBarcodeFindViewProxy extends BaseNativeProxy {
1672
1672
  updateView(barcodeFindViewJson) {
1673
1673
  return ScanditBarcodeFindPluginNative.updateFindView(JSON.parse(barcodeFindViewJson));
1674
1674
  }
1675
+ removeView() {
1676
+ return ScanditBarcodeFindPluginNative.removeFindView();
1677
+ }
1675
1678
  subscribeBarcodeFindViewListener() {
1676
1679
  this.subscriptionBarcodeFindViewListener = window.Capacitor.Plugins[Capacitor.pluginName]
1677
1680
  .addListener(BarcodeFindViewEvents.onFinishButtonTappedEventName, this.notifyListeners.bind(this));
@@ -1989,7 +1992,7 @@ class BarcodeFindView {
1989
1992
  setTimeout(this.elementDidChange.bind(this), 300);
1990
1993
  setTimeout(this.elementDidChange.bind(this), 1000);
1991
1994
  });
1992
- this.baseBarcodeFindView = new BaseBarcodeFindView(dataCaptureContext, barcodeFind, barcodeFindViewSettings, cameraSettings);
1995
+ this.baseBarcodeFindView = new BaseBarcodeFindView(dataCaptureContext, barcodeFind, barcodeFindViewSettings, cameraSettings, false);
1993
1996
  this.baseBarcodeFindView.initialize(this);
1994
1997
  }
1995
1998
  set htmlElementState(newState) {
@@ -2119,16 +2122,20 @@ class BarcodeFindView {
2119
2122
  return this.baseBarcodeFindView.pauseSearching();
2120
2123
  }
2121
2124
  connectToElement(element) {
2122
- this.htmlElement = element;
2123
- this.htmlElementState = new HTMLElementState();
2124
- // Initial update
2125
- this.elementDidChange();
2126
- this.subscribeToChangesOnHTMLElement();
2125
+ this.baseBarcodeFindView.createNativeView().then(() => {
2126
+ this.htmlElement = element;
2127
+ this.htmlElementState = new HTMLElementState();
2128
+ // Initial update
2129
+ this.elementDidChange();
2130
+ this.subscribeToChangesOnHTMLElement();
2131
+ });
2127
2132
  }
2128
2133
  detachFromElement() {
2129
- this.unsubscribeFromChangesOnHTMLElement();
2130
- this.htmlElement = null;
2131
- this.elementDidChange();
2134
+ this.baseBarcodeFindView.removeNativeView().then(() => {
2135
+ this.unsubscribeFromChangesOnHTMLElement();
2136
+ this.htmlElement = null;
2137
+ this.elementDidChange();
2138
+ });
2132
2139
  }
2133
2140
  show() {
2134
2141
  if (this.htmlElement) {