react-native-rectangle-doc-scanner 3.163.0 → 3.164.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.
|
@@ -78,7 +78,7 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
|
|
|
78
78
|
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
|
79
79
|
scaleType = PreviewView.ScaleType.FILL_CENTER
|
|
80
80
|
// Force TextureView for React Native compatibility (SurfaceView has rendering issues)
|
|
81
|
-
implementationMode = PreviewView.ImplementationMode.
|
|
81
|
+
implementationMode = PreviewView.ImplementationMode.TEXTURE_VIEW
|
|
82
82
|
}
|
|
83
83
|
Log.d(TAG, "[INIT] PreviewView created: $previewView")
|
|
84
84
|
Log.d(TAG, "[INIT] PreviewView implementationMode: ${previewView.implementationMode}")
|
|
@@ -96,10 +96,6 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
|
|
|
96
96
|
addView(overlayView)
|
|
97
97
|
Log.d(TAG, "[INIT] OverlayView added, childCount: $childCount")
|
|
98
98
|
|
|
99
|
-
Log.d(TAG, "[INIT] Setting lifecycle to CREATED...")
|
|
100
|
-
lifecycleRegistry.currentState = Lifecycle.State.CREATED
|
|
101
|
-
Log.d(TAG, "[INIT] Lifecycle state: ${lifecycleRegistry.currentState}")
|
|
102
|
-
|
|
103
99
|
Log.d(TAG, "╔════════════════════════════════════════╗")
|
|
104
100
|
Log.d(TAG, "║ DocumentScannerView INIT COMPLETE ║")
|
|
105
101
|
Log.d(TAG, "╚════════════════════════════════════════╝")
|
|
@@ -117,6 +113,9 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
|
|
|
117
113
|
// Setup and start camera when view is attached
|
|
118
114
|
post {
|
|
119
115
|
Log.d(TAG, "[POST] Starting camera setup...")
|
|
116
|
+
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE)
|
|
117
|
+
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START)
|
|
118
|
+
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME)
|
|
120
119
|
setupCamera()
|
|
121
120
|
startCamera()
|
|
122
121
|
}
|
|
@@ -408,23 +407,11 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
|
|
|
408
407
|
}
|
|
409
408
|
|
|
410
409
|
// Transition lifecycle states properly
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
Lifecycle.
|
|
414
|
-
|
|
415
|
-
lifecycleRegistry.currentState = Lifecycle.State.STARTED
|
|
416
|
-
Log.d(TAG, "[START_CAMERA] Transitioning STARTED -> RESUMED")
|
|
417
|
-
lifecycleRegistry.currentState = Lifecycle.State.RESUMED
|
|
418
|
-
}
|
|
419
|
-
Lifecycle.State.STARTED -> {
|
|
420
|
-
Log.d(TAG, "[START_CAMERA] Transitioning STARTED -> RESUMED")
|
|
421
|
-
lifecycleRegistry.currentState = Lifecycle.State.RESUMED
|
|
422
|
-
}
|
|
423
|
-
else -> {
|
|
424
|
-
Log.d(TAG, "[START_CAMERA] Already in state: ${lifecycleRegistry.currentState}")
|
|
425
|
-
}
|
|
410
|
+
Log.d(TAG, "[START_CAMERA] Ensuring lifecycle is RESUMED")
|
|
411
|
+
if (lifecycleRegistry.currentState != Lifecycle.State.DESTROYED) {
|
|
412
|
+
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START)
|
|
413
|
+
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME)
|
|
426
414
|
}
|
|
427
|
-
Log.d(TAG, "[START_CAMERA] Lifecycle transitioned: $previousState -> ${lifecycleRegistry.currentState}")
|
|
428
415
|
|
|
429
416
|
Log.d(TAG, "[START_CAMERA] Calling CameraController.startCamera()...")
|
|
430
417
|
try {
|
package/package.json
CHANGED