react-native-rectangle-doc-scanner 10.0.0 → 10.2.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.
@@ -90,6 +90,8 @@ class CameraController(
90
90
  // Preview UseCase
91
91
  Log.d(TAG, "[CAMERAX] PreviewView size: ${previewView.width}x${previewView.height}")
92
92
  Log.d(TAG, "[CAMERAX] PreviewView visibility: ${previewView.visibility}")
93
+ Log.d(TAG, "[CAMERAX] PreviewView scaleType: ${previewView.scaleType}")
94
+ Log.d(TAG, "[CAMERAX] PreviewView implementationMode: ${previewView.implementationMode}")
93
95
  preview = Preview.Builder()
94
96
  .build()
95
97
  .also {
@@ -131,6 +133,19 @@ class CameraController(
131
133
 
132
134
  Log.d(TAG, "[CAMERAX] Camera bound successfully")
133
135
 
136
+ // Monitor preview stream state
137
+ previewView.previewStreamState.observe(lifecycleOwner) { state ->
138
+ Log.d(TAG, "[CAMERAX] PreviewStreamState changed: $state")
139
+ when (state) {
140
+ androidx.camera.view.PreviewView.StreamState.IDLE ->
141
+ Log.w(TAG, "[CAMERAX] Preview stream is IDLE")
142
+ androidx.camera.view.PreviewView.StreamState.STREAMING ->
143
+ Log.d(TAG, "[CAMERAX] Preview stream is STREAMING ✓")
144
+ else ->
145
+ Log.d(TAG, "[CAMERAX] Preview stream state: $state")
146
+ }
147
+ }
148
+
134
149
  } catch (e: Exception) {
135
150
  Log.e(TAG, "[CAMERAX] Use case binding failed", e)
136
151
  }
@@ -94,20 +94,20 @@ class DocumentScannerView(context: ThemedReactContext) : FrameLayout(context), L
94
94
  Log.d(TAG, "[INIT] PreviewView visibility: ${previewView.visibility}")
95
95
 
96
96
  Log.d(TAG, "[INIT] Adding PreviewView to parent...")
97
- addView(previewView)
97
+ addView(previewView, 0) // Add at index 0 (back)
98
98
  Log.d(TAG, "[INIT] PreviewView added, childCount: $childCount")
99
99
 
100
100
  // Create overlay view for drawing rectangle
101
101
  Log.d(TAG, "[INIT] Creating OverlayView...")
102
102
  overlayView = OverlayView(context).apply {
103
103
  layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
104
- // Ensure overlay is drawn on top
105
- bringToFront()
104
+ setBackgroundColor(android.graphics.Color.TRANSPARENT)
105
+ setWillNotDraw(false)
106
106
  }
107
107
  Log.d(TAG, "[INIT] OverlayView created: $overlayView")
108
108
 
109
109
  Log.d(TAG, "[INIT] Adding OverlayView to parent...")
110
- addView(overlayView)
110
+ addView(overlayView, 1) // Add at index 1 (front)
111
111
  Log.d(TAG, "[INIT] OverlayView added, childCount: $childCount")
112
112
 
113
113
  Log.d(TAG, "╔════════════════════════════════════════╗")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "10.0.0",
3
+ "version": "10.2.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",