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.
@@ -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", '= 8.5.3'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 8.6.0'
21
21
  end
@@ -143,7 +143,7 @@ if (ext.has('repos')) {
143
143
  }
144
144
 
145
145
  dependencies {
146
- def sdk_version = "8.5.3"
146
+ def sdk_version = "8.6.0"
147
147
 
148
148
  implementation fileTree(dir: 'libs', include: ['*.jar'])
149
149
  implementation fileTree(dir: 'library', include: ['*.aar'])
@@ -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
- ((View) webView.getParent()).setTranslationZ(1F);
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
- ((View) webView.getParent()).setTranslationZ(-1F);
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()) {