scandit-capacitor-datacapture-barcode 8.5.3 → 8.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.
- package/ScanditCapacitorDatacaptureBarcode.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ar/BarcodeArViewHandler.java +23 -6
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/count/BarcodeCountViewHandler.java +6 -4
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/find/BarcodeFindViewHandler.java +5 -4
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/pick/BarcodePickViewHandler.java +5 -4
- package/dist/barcode.js +652 -45
- package/dist/barcode.js.map +1 -1
- package/dist/dts/barcode.d.ts +6674 -0
- package/dist/dts/index.d.ts +462 -2
- package/dist/index.js +75 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -6
- package/dist/dts/definitions.d.ts +0 -213
- package/dist/dts/ts/BarcodeArView.d.ts +0 -57
- package/dist/dts/ts/BarcodeBatchAdvancedOverlay.d.ts +0 -21
- package/dist/dts/ts/BarcodeBatchAdvancedOverlayListener.d.ts +0 -10
- package/dist/dts/ts/BarcodeCountView.d.ts +0 -171
- package/dist/dts/ts/BarcodeFindView.d.ts +0 -64
- package/dist/dts/ts/BarcodePickView.d.ts +0 -41
- package/dist/dts/ts/Capacitor/BarcodeNativeCallerProvider.d.ts +0 -5
- package/dist/dts/ts/Capacitor/Capacitor.d.ts +0 -14
- package/dist/dts/ts/Capacitor/initBarcodeProxy.d.ts +0 -1
- package/dist/dts/ts/SparkScanView.d.ts +0 -61
- package/dist/dts/ts/TrackedBarcodeView.d.ts +0 -24
- package/dist/dts/web.d.ts +0 -6
package/android/build.gradle
CHANGED
package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ar/BarcodeArViewHandler.java
CHANGED
|
@@ -8,6 +8,7 @@ package com.scandit.capacitor.datacapture.barcode.ar;
|
|
|
8
8
|
|
|
9
9
|
import static com.scandit.capacitor.datacapture.core.utils.CapacitorExtensions.*;
|
|
10
10
|
|
|
11
|
+
import android.content.Context;
|
|
11
12
|
import android.view.View;
|
|
12
13
|
import android.view.ViewGroup;
|
|
13
14
|
import android.widget.FrameLayout;
|
|
@@ -110,6 +111,9 @@ public class BarcodeArViewHandler {
|
|
|
110
111
|
View webView = webViewReference.get();
|
|
111
112
|
if (webView != null) {
|
|
112
113
|
webView.bringToFront();
|
|
114
|
+
// Raise the Z too, or the elevation set while the AR view was on top
|
|
115
|
+
// outlives it and leaves the next screen's WebView below a stale layer.
|
|
116
|
+
webView.setTranslationZ(2F);
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
|
|
@@ -121,23 +125,36 @@ public class BarcodeArViewHandler {
|
|
|
121
125
|
return;
|
|
122
126
|
}
|
|
123
127
|
|
|
128
|
+
Context context = container.getContext();
|
|
124
129
|
container.setVisibility(isVisible ? View.VISIBLE : View.GONE);
|
|
125
|
-
container.setX(pxFromDp(latestInfo.getLeft()));
|
|
126
|
-
container.setY(pxFromDp(latestInfo.getTop()));
|
|
130
|
+
container.setX(pxFromDp(latestInfo.getLeft(), context));
|
|
131
|
+
container.setY(pxFromDp(latestInfo.getTop(), context));
|
|
127
132
|
ViewGroup.LayoutParams params = container.getLayoutParams();
|
|
128
|
-
params.width = (int) pxFromDp(latestInfo.getWidth());
|
|
129
|
-
params.height = (int) pxFromDp(latestInfo.getHeight());
|
|
133
|
+
params.width = (int) pxFromDp(latestInfo.getWidth(), context);
|
|
134
|
+
params.height = (int) pxFromDp(latestInfo.getHeight(), context);
|
|
130
135
|
|
|
131
136
|
View webView = webViewReference.get();
|
|
137
|
+
// Order the container against the WebView by elevation, the way
|
|
138
|
+
// DataCaptureViewHandler does. bringToFront() alone is not enough:
|
|
139
|
+
// Android resolves both drawing and touch dispatch by Z before child
|
|
140
|
+
// order, and a DataCaptureView visited earlier in the session leaves
|
|
141
|
+
// the WebView at a raised translationZ that is never reset. The
|
|
142
|
+
// WebView then keeps swallowing taps while its transparent background
|
|
143
|
+
// still shows the camera preview, so the AR view renders but no
|
|
144
|
+
// highlight tap ever reaches it (SDC-33081). Setting the Z on
|
|
145
|
+
// webView.getParent() cannot fix that either — the container shares
|
|
146
|
+
// that parent, so it moves both together.
|
|
132
147
|
if (latestInfo.getShouldBeUnderWebView()) {
|
|
133
148
|
if (webView != null) {
|
|
134
149
|
webView.bringToFront();
|
|
135
|
-
|
|
150
|
+
webView.setTranslationZ(2F);
|
|
136
151
|
}
|
|
152
|
+
container.setTranslationZ(1F);
|
|
137
153
|
} else {
|
|
138
154
|
container.bringToFront();
|
|
155
|
+
container.setTranslationZ(2F);
|
|
139
156
|
if (webView != null) {
|
|
140
|
-
|
|
157
|
+
webView.setTranslationZ(1F);
|
|
141
158
|
}
|
|
142
159
|
}
|
|
143
160
|
container.requestLayout();
|
|
@@ -8,6 +8,7 @@ package com.scandit.capacitor.datacapture.barcode.count;
|
|
|
8
8
|
|
|
9
9
|
import static com.scandit.capacitor.datacapture.core.utils.CapacitorExtensions.*;
|
|
10
10
|
|
|
11
|
+
import android.content.Context;
|
|
11
12
|
import android.graphics.Color;
|
|
12
13
|
import android.view.View;
|
|
13
14
|
import android.view.ViewGroup;
|
|
@@ -118,12 +119,13 @@ public class BarcodeCountViewHandler {
|
|
|
118
119
|
private void renderNoAnimate(BarcodeCountView barcodeCountView) {
|
|
119
120
|
barcodeCountView.post(
|
|
120
121
|
() -> {
|
|
122
|
+
Context context = barcodeCountView.getContext();
|
|
121
123
|
barcodeCountView.setVisibility(View.VISIBLE);
|
|
122
|
-
barcodeCountView.setX(pxFromDp(latestInfo.getLeft()));
|
|
123
|
-
barcodeCountView.setY(pxFromDp(latestInfo.getTop()));
|
|
124
|
+
barcodeCountView.setX(pxFromDp(latestInfo.getLeft(), context));
|
|
125
|
+
barcodeCountView.setY(pxFromDp(latestInfo.getTop(), context));
|
|
124
126
|
ViewGroup.LayoutParams params = barcodeCountView.getLayoutParams();
|
|
125
|
-
params.width = (int) pxFromDp(latestInfo.getWidth());
|
|
126
|
-
params.height = (int) pxFromDp(latestInfo.getHeight());
|
|
127
|
+
params.width = (int) pxFromDp(latestInfo.getWidth(), context);
|
|
128
|
+
params.height = (int) pxFromDp(latestInfo.getHeight(), context);
|
|
127
129
|
|
|
128
130
|
View webView = getWebView();
|
|
129
131
|
if (latestInfo.getShouldBeUnderWebView()) {
|
|
@@ -137,12 +137,13 @@ public class BarcodeFindViewHandler {
|
|
|
137
137
|
private void renderNoAnimate(FrameLayout container, boolean isVisible) {
|
|
138
138
|
container.post(
|
|
139
139
|
() -> {
|
|
140
|
+
Context context = container.getContext();
|
|
140
141
|
container.setVisibility(isVisible ? View.VISIBLE : View.GONE);
|
|
141
|
-
container.setX(pxFromDp(latestInfo.getLeft()));
|
|
142
|
-
container.setY(pxFromDp(latestInfo.getTop()));
|
|
142
|
+
container.setX(pxFromDp(latestInfo.getLeft(), context));
|
|
143
|
+
container.setY(pxFromDp(latestInfo.getTop(), context));
|
|
143
144
|
ViewGroup.LayoutParams params = container.getLayoutParams();
|
|
144
|
-
params.width = (int) pxFromDp(latestInfo.getWidth());
|
|
145
|
-
params.height = (int) pxFromDp(latestInfo.getHeight());
|
|
145
|
+
params.width = (int) pxFromDp(latestInfo.getWidth(), context);
|
|
146
|
+
params.height = (int) pxFromDp(latestInfo.getHeight(), context);
|
|
146
147
|
|
|
147
148
|
View webView = getWebView();
|
|
148
149
|
if (latestInfo.getShouldBeUnderWebView()) {
|
|
@@ -127,12 +127,13 @@ public class BarcodePickViewHandler {
|
|
|
127
127
|
private void renderNoAnimate(FrameLayout barcodePickViewContainer) {
|
|
128
128
|
barcodePickViewContainer.post(
|
|
129
129
|
() -> {
|
|
130
|
+
Context context = barcodePickViewContainer.getContext();
|
|
130
131
|
barcodePickViewContainer.setVisibility(View.VISIBLE);
|
|
131
|
-
barcodePickViewContainer.setX(pxFromDp(latestInfo.getLeft()));
|
|
132
|
-
barcodePickViewContainer.setY(pxFromDp(latestInfo.getTop()));
|
|
132
|
+
barcodePickViewContainer.setX(pxFromDp(latestInfo.getLeft(), context));
|
|
133
|
+
barcodePickViewContainer.setY(pxFromDp(latestInfo.getTop(), context));
|
|
133
134
|
ViewGroup.LayoutParams params = barcodePickViewContainer.getLayoutParams();
|
|
134
|
-
params.width = (int) pxFromDp(latestInfo.getWidth());
|
|
135
|
-
params.height = (int) pxFromDp(latestInfo.getHeight());
|
|
135
|
+
params.width = (int) pxFromDp(latestInfo.getWidth(), context);
|
|
136
|
+
params.height = (int) pxFromDp(latestInfo.getHeight(), context);
|
|
136
137
|
|
|
137
138
|
View webView = getWebView();
|
|
138
139
|
if (latestInfo.getShouldBeUnderWebView()) {
|