react-native-rectangle-doc-scanner 7.0.0 → 7.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.
package/android/build.gradle
CHANGED
|
@@ -48,10 +48,10 @@ android {
|
|
|
48
48
|
main {
|
|
49
49
|
java.srcDirs += 'src/main/kotlin'
|
|
50
50
|
java.srcDirs += 'src/common/kotlin'
|
|
51
|
+
// Always include camera2 sources (for fallback when VisionCamera is not used at runtime)
|
|
52
|
+
java.srcDirs += 'src/camera2/kotlin'
|
|
51
53
|
if (hasVisionCamera) {
|
|
52
54
|
java.srcDirs += 'src/visioncamera/kotlin'
|
|
53
|
-
} else {
|
|
54
|
-
java.srcDirs += 'src/camera2/kotlin'
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -77,18 +77,18 @@ dependencies {
|
|
|
77
77
|
implementation 'androidx.core:core-ktx:1.10.1'
|
|
78
78
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
79
79
|
|
|
80
|
+
// CameraX dependencies (always included for Camera2 fallback and ImageProxy support)
|
|
81
|
+
def camerax_version = "1.3.0"
|
|
82
|
+
implementation "androidx.camera:camera-core:${camerax_version}"
|
|
83
|
+
implementation "androidx.camera:camera-camera2:${camerax_version}"
|
|
84
|
+
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
|
|
85
|
+
implementation "androidx.camera:camera-view:${camerax_version}"
|
|
86
|
+
|
|
87
|
+
// ML Kit object detection for live rectangle hints (Camera2 mode)
|
|
88
|
+
implementation 'com.google.mlkit:object-detection:17.0.1'
|
|
89
|
+
|
|
80
90
|
if (hasVisionCamera) {
|
|
81
|
-
// VisionCamera mode -
|
|
91
|
+
// VisionCamera mode - include VisionCamera dependency
|
|
82
92
|
implementation project(':react-native-vision-camera')
|
|
83
|
-
} else {
|
|
84
|
-
// Camera2 mode - include CameraX and ML Kit dependencies
|
|
85
|
-
def camerax_version = "1.3.0"
|
|
86
|
-
implementation "androidx.camera:camera-core:${camerax_version}"
|
|
87
|
-
implementation "androidx.camera:camera-camera2:${camerax_version}"
|
|
88
|
-
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
|
|
89
|
-
implementation "androidx.camera:camera-view:${camerax_version}"
|
|
90
|
-
|
|
91
|
-
// ML Kit object detection for live rectangle hints
|
|
92
|
-
implementation 'com.google.mlkit:object-detection:17.0.1'
|
|
93
93
|
}
|
|
94
94
|
}
|
package/android/src/main/kotlin/com/reactnativerectangledocscanner/DocumentScannerPackage.kt
CHANGED
|
@@ -19,18 +19,11 @@ class DocumentScannerPackage : ReactPackage {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
22
|
-
//
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} catch (e: ClassNotFoundException) {
|
|
28
|
-
// VisionCamera not available, register Camera2 view managers
|
|
29
|
-
listOf(
|
|
30
|
-
DocumentScannerViewManager(),
|
|
31
|
-
CameraViewManager()
|
|
32
|
-
)
|
|
33
|
-
}
|
|
22
|
+
// Always register Camera2 view managers for fallback support
|
|
23
|
+
return listOf(
|
|
24
|
+
DocumentScannerViewManager(),
|
|
25
|
+
CameraViewManager()
|
|
26
|
+
)
|
|
34
27
|
}
|
|
35
28
|
|
|
36
29
|
private fun registerVisionCameraPlugin() {
|
package/package.json
CHANGED
/package/android/src/{camera2 → common}/kotlin/com/reactnativerectangledocscanner/ImageProxyExt.kt
RENAMED
|
File without changes
|