react-native-rectangle-doc-scanner 3.177.0 → 3.179.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.
|
@@ -165,17 +165,18 @@ class CameraController(
|
|
|
165
165
|
)
|
|
166
166
|
Log.d(TAG, "[BIND] Bound to lifecycle successfully, camera: $camera")
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
// Set surface provider AFTER binding for all modes
|
|
169
|
+
// This ensures the camera is ready to receive the surface
|
|
170
|
+
Log.d(TAG, "[BIND] Binding completed, now setting surface provider...")
|
|
169
171
|
Log.d(TAG, "[BIND] PreviewView: $previewView")
|
|
170
172
|
Log.d(TAG, "[BIND] PreviewView.surfaceProvider: ${previewView.surfaceProvider}")
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Log.d(TAG, "[BIND]
|
|
176
|
-
} else {
|
|
173
|
+
Log.d(TAG, "[BIND] PreviewView.implementationMode: ${previewView.implementationMode}")
|
|
174
|
+
|
|
175
|
+
// Use postDelayed to ensure surface is ready (especially for SurfaceView)
|
|
176
|
+
previewView.post {
|
|
177
|
+
Log.d(TAG, "[BIND] Setting surface provider on UI thread...")
|
|
177
178
|
preview.setSurfaceProvider(previewView.surfaceProvider)
|
|
178
|
-
Log.d(TAG, "[BIND] Surface provider set
|
|
179
|
+
Log.d(TAG, "[BIND] Surface provider set successfully")
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
// Restore torch state if it was enabled
|
|
@@ -77,10 +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
|
-
implementationMode = PreviewView.ImplementationMode.
|
|
80
|
+
// Use PERFORMANCE (SurfaceView) for better reliability
|
|
81
|
+
implementationMode = PreviewView.ImplementationMode.PERFORMANCE
|
|
82
82
|
visibility = View.VISIBLE
|
|
83
83
|
keepScreenOn = true
|
|
84
|
+
// Force view to be drawn
|
|
85
|
+
setWillNotDraw(false)
|
|
84
86
|
requestLayout()
|
|
85
87
|
}
|
|
86
88
|
Log.d(TAG, "[INIT] PreviewView created: $previewView")
|
package/package.json
CHANGED