react-native-rectangle-doc-scanner 3.169.0 → 3.171.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.
|
@@ -141,6 +141,10 @@ class CameraController(
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
try {
|
|
144
|
+
Log.d(TAG, "[BIND] PreviewView: $previewView")
|
|
145
|
+
Log.d(TAG, "[BIND] PreviewView.surfaceProvider: ${previewView.surfaceProvider}")
|
|
146
|
+
Log.d(TAG, "[BIND] PreviewView attached to window: ${previewView.isAttachedToWindow}")
|
|
147
|
+
Log.d(TAG, "[BIND] PreviewView size: ${previewView.width}x${previewView.height}")
|
|
144
148
|
// Unbind all use cases before rebinding
|
|
145
149
|
Log.d(TAG, "[BIND] Unbinding all existing use cases...")
|
|
146
150
|
cameraProvider.unbindAll()
|
|
@@ -160,10 +164,11 @@ class CameraController(
|
|
|
160
164
|
)
|
|
161
165
|
Log.d(TAG, "[BIND] Bound to lifecycle successfully, camera: $camera")
|
|
162
166
|
|
|
163
|
-
// Set surface provider AFTER binding to lifecycle
|
|
164
167
|
Log.d(TAG, "[BIND] Setting surface provider to previewView...")
|
|
165
168
|
Log.d(TAG, "[BIND] PreviewView: $previewView")
|
|
166
169
|
Log.d(TAG, "[BIND] PreviewView.surfaceProvider: ${previewView.surfaceProvider}")
|
|
170
|
+
// Devices with the SurfaceOrderQuirk expect the preview surface to be set last.
|
|
171
|
+
// Apply the SurfaceProvider after binding so the preview stays on top.
|
|
167
172
|
preview.setSurfaceProvider(previewView.surfaceProvider)
|
|
168
173
|
Log.d(TAG, "[BIND] Surface provider set successfully")
|
|
169
174
|
|
|
@@ -77,11 +77,12 @@ 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
|
-
// Use
|
|
81
|
-
|
|
82
|
-
implementationMode = PreviewView.ImplementationMode.COMPATIBLE
|
|
80
|
+
// Use PERFORMANCE mode (SurfaceView) for better performance
|
|
81
|
+
implementationMode = PreviewView.ImplementationMode.PERFORMANCE
|
|
83
82
|
// Force visibility to ensure the view is rendered
|
|
84
83
|
visibility = View.VISIBLE
|
|
84
|
+
// Keep the screen on while preview is active
|
|
85
|
+
keepScreenOn = true
|
|
85
86
|
// Request layout to ensure proper sizing
|
|
86
87
|
requestLayout()
|
|
87
88
|
}
|
package/package.json
CHANGED