react-native-rectangle-doc-scanner 3.166.0 → 3.167.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.
|
@@ -53,7 +53,9 @@ class CameraView(context: Context) : FrameLayout(context), LifecycleOwner {
|
|
|
53
53
|
// Create preview view
|
|
54
54
|
previewView = PreviewView(context).apply {
|
|
55
55
|
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
|
56
|
-
|
|
56
|
+
// Keep the preview visible on devices where the TextureView based mode
|
|
57
|
+
// renders black frames by forcing the SurfaceView implementation.
|
|
58
|
+
implementationMode = PreviewView.ImplementationMode.PERFORMANCE
|
|
57
59
|
}
|
|
58
60
|
addView(previewView)
|
|
59
61
|
|
|
@@ -77,7 +77,11 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
|
|
|
77
77
|
previewView = PreviewView(context).apply {
|
|
78
78
|
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
|
79
79
|
scaleType = PreviewView.ScaleType.FILL_CENTER
|
|
80
|
-
|
|
80
|
+
// Some MediaTek based devices render a black TextureView preview when
|
|
81
|
+
// using the COMPATIBLE implementation. Forcing the SurfaceView backed
|
|
82
|
+
// PERFORMANCE mode keeps the preview visible while still allowing us
|
|
83
|
+
// to draw our overlay on top.
|
|
84
|
+
implementationMode = PreviewView.ImplementationMode.PERFORMANCE
|
|
81
85
|
}
|
|
82
86
|
Log.d(TAG, "[INIT] PreviewView created: $previewView")
|
|
83
87
|
Log.d(TAG, "[INIT] PreviewView implementationMode: ${previewView.implementationMode}")
|
package/package.json
CHANGED