react-native-rectangle-doc-scanner 3.168.0 → 3.170.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,15 @@ class CameraController(
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
try {
|
|
144
|
+
// Set surface provider BEFORE binding to lifecycle
|
|
145
|
+
Log.d(TAG, "[BIND] Setting surface provider to previewView...")
|
|
146
|
+
Log.d(TAG, "[BIND] PreviewView: $previewView")
|
|
147
|
+
Log.d(TAG, "[BIND] PreviewView.surfaceProvider: ${previewView.surfaceProvider}")
|
|
148
|
+
Log.d(TAG, "[BIND] PreviewView attached to window: ${previewView.isAttachedToWindow}")
|
|
149
|
+
Log.d(TAG, "[BIND] PreviewView size: ${previewView.width}x${previewView.height}")
|
|
150
|
+
preview.setSurfaceProvider(previewView.surfaceProvider)
|
|
151
|
+
Log.d(TAG, "[BIND] Surface provider set successfully")
|
|
152
|
+
|
|
144
153
|
// Unbind all use cases before rebinding
|
|
145
154
|
Log.d(TAG, "[BIND] Unbinding all existing use cases...")
|
|
146
155
|
cameraProvider.unbindAll()
|
|
@@ -160,13 +169,6 @@ class CameraController(
|
|
|
160
169
|
)
|
|
161
170
|
Log.d(TAG, "[BIND] Bound to lifecycle successfully, camera: $camera")
|
|
162
171
|
|
|
163
|
-
// Set surface provider AFTER binding to lifecycle
|
|
164
|
-
Log.d(TAG, "[BIND] Setting surface provider to previewView...")
|
|
165
|
-
Log.d(TAG, "[BIND] PreviewView: $previewView")
|
|
166
|
-
Log.d(TAG, "[BIND] PreviewView.surfaceProvider: ${previewView.surfaceProvider}")
|
|
167
|
-
preview.setSurfaceProvider(previewView.surfaceProvider)
|
|
168
|
-
Log.d(TAG, "[BIND] Surface provider set successfully")
|
|
169
|
-
|
|
170
172
|
// Restore torch state if it was enabled
|
|
171
173
|
if (torchEnabled) {
|
|
172
174
|
Log.d(TAG, "[BIND] Restoring torch state...")
|
|
@@ -77,13 +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
|
-
//
|
|
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.
|
|
80
|
+
// Use PERFORMANCE mode (SurfaceView) for better performance
|
|
84
81
|
implementationMode = PreviewView.ImplementationMode.PERFORMANCE
|
|
85
82
|
// Force visibility to ensure the view is rendered
|
|
86
83
|
visibility = View.VISIBLE
|
|
84
|
+
// Keep the screen on while preview is active
|
|
85
|
+
keepScreenOn = true
|
|
87
86
|
// Request layout to ensure proper sizing
|
|
88
87
|
requestLayout()
|
|
89
88
|
}
|
package/package.json
CHANGED