react-native-rectangle-doc-scanner 3.163.0 → 3.165.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.
@@ -77,8 +77,7 @@ 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
- // Force TextureView for React Native compatibility (SurfaceView has rendering issues)
81
- implementationMode = PreviewView.ImplementationMode.COMPATIBLE
80
+ preferredImplementationMode = PreviewView.ImplementationMode.COMPATIBLE
82
81
  }
83
82
  Log.d(TAG, "[INIT] PreviewView created: $previewView")
84
83
  Log.d(TAG, "[INIT] PreviewView implementationMode: ${previewView.implementationMode}")
@@ -96,10 +95,6 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
96
95
  addView(overlayView)
97
96
  Log.d(TAG, "[INIT] OverlayView added, childCount: $childCount")
98
97
 
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
98
  Log.d(TAG, "╔════════════════════════════════════════╗")
104
99
  Log.d(TAG, "║ DocumentScannerView INIT COMPLETE ║")
105
100
  Log.d(TAG, "╚════════════════════════════════════════╝")
@@ -117,6 +112,9 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
117
112
  // Setup and start camera when view is attached
118
113
  post {
119
114
  Log.d(TAG, "[POST] Starting camera setup...")
115
+ lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE)
116
+ lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START)
117
+ lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME)
120
118
  setupCamera()
121
119
  startCamera()
122
120
  }
@@ -408,23 +406,11 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
408
406
  }
409
407
 
410
408
  // Transition lifecycle states properly
411
- val previousState = lifecycleRegistry.currentState
412
- when (lifecycleRegistry.currentState) {
413
- Lifecycle.State.CREATED -> {
414
- Log.d(TAG, "[START_CAMERA] Transitioning CREATED -> STARTED")
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
- }
409
+ Log.d(TAG, "[START_CAMERA] Ensuring lifecycle is RESUMED")
410
+ if (lifecycleRegistry.currentState != Lifecycle.State.DESTROYED) {
411
+ lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START)
412
+ lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME)
426
413
  }
427
- Log.d(TAG, "[START_CAMERA] Lifecycle transitioned: $previousState -> ${lifecycleRegistry.currentState}")
428
414
 
429
415
  Log.d(TAG, "[START_CAMERA] Calling CameraController.startCamera()...")
430
416
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.163.0",
3
+ "version": "3.165.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",