Auto-Commit: 2026-08-18 20:54:11
This commit is contained in:
1 parent
b304344278
commit
176608d8b7
17 files changed
+123
-51
No files matched your search
@@ -58,3 +58,8 @@
|
||||
5 38 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
|
||||
6 55 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
|
||||
3 31 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
|
||||
4 59 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
|
||||
10 76 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
|
||||
5 49 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
|
||||
12 182 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
|
||||
5 70 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
|
||||
@@ -2,41 +2,41 @@ C/C++ Structured Logg
|
||||
e
|
||||
cC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint íÿË�4Å, ½Ñªðò3d
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint «’ѱ�4Å, ½Ñªðò3d
|
||||
b
|
||||
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build.json íÿË�4û" ÂѪðò3i
|
||||
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build.json «’ѱ�4û" ÂѪðò3i
|
||||
g
|
||||
eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build_mini.json íÿË�4ï Òªðò3V
|
||||
eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build_mini.json «’ѱ�4ï Òªðò3V
|
||||
T
|
||||
RC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja íÿË�4œÞ åͪðò3Z
|
||||
RC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja «’ѱ�4œÞ åͪðò3Z
|
||||
X
|
||||
VC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja.txt íÿË�4_
|
||||
VC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja.txt «’ѱ�4_
|
||||
]
|
||||
[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build_file_index.txt íÿË�4� ¨Òªðò3`
|
||||
[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build_file_index.txt «’ѱ�4� ¨Òªðò3`
|
||||
^
|
||||
\C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json íÿË�4‘Ø ãͪðò3d
|
||||
\C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json «’ѱ�4‘Ø ãͪðò3d
|
||||
b
|
||||
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json.bin íÿË�4 Ê„ ãͪðò3j
|
||||
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json.bin «’ѱ�4 Ê„ ãͪðò3j
|
||||
h
|
||||
fC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\metadata_generation_command.txt íÿË�4
|
||||
fC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\metadata_generation_command.txt «’ѱ�4
|
||||
¸ §Òªðò3]
|
||||
[
|
||||
YC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\prefab_config.json íÿË�4€ ¨Òªðò3b
|
||||
YC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\prefab_config.json «’ѱ�4€ ¨Òªðò3b
|
||||
`
|
||||
^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\symbol_folder_index.txt íÿË�4␍] ¨Òªðò3{
|
||||
^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\symbol_folder_index.txt «’ѱ�4␍] ¨Òªðò3{
|
||||
y
|
||||
wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt íÿË�4␍¾ Ü…§ðò3v
|
||||
wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt «’ѱ�4␍¾ Ü…§ðò3v
|
||||
t
|
||||
rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt íÿË�4ö ùާðò3µ
|
||||
rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt «’ѱ�4ö ùާðò3µ
|
||||
²
|
||||
¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json íÿË�4Y
|
||||
¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json «’ѱ�4Y
|
||||
W
|
||||
UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt íÿË�4½ œ§ØÖç3u
|
||||
UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt «’ѱ�4½ œ§ØÖç3u
|
||||
s
|
||||
qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt íÿË�4ê ú„§ðò3t
|
||||
qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt «’ѱ�4ê ú„§ðò3t
|
||||
r
|
||||
pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt íÿË�4ê è„§ðò3³
|
||||
pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt «’ѱ�4ê è„§ðò3³
|
||||
°
|
||||
C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json íÿË�4k
|
||||
C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json «’ѱ�4k
|
||||
i
|
||||
gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt íÿË�4ð ®¡ÈÑç3
|
||||
gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt «’ѱ�4ð ®¡ÈÑç3
|
||||
@@ -58,3 +58,8 @@
|
||||
3 34 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
|
||||
3 49 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
|
||||
3 50 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
|
||||
8 111 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
|
||||
4 49 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
|
||||
4 47 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
|
||||
4 62 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
|
||||
11 74 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
|
||||
@@ -2,41 +2,41 @@ C/C++ Structured Logi
|
||||
g
|
||||
eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Ù‚Ì�4ý, ÷Ãðò3f
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint �•ѱ�4ý, ÷Ãðò3f
|
||||
d
|
||||
bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build.json Ù‚Ì�4�# øÃðò3k
|
||||
bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build.json �•ѱ�4�# øÃðò3k
|
||||
i
|
||||
gC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build_mini.json Ù‚Ì�4‘ ŸÄðò3X
|
||||
gC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build_mini.json ‘•ѱ�4‘ ŸÄðò3X
|
||||
V
|
||||
TC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja Ù‚Ì�4Áå âÀðò3\
|
||||
TC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja ‘•ѱ�4Áå âÀðò3\
|
||||
Z
|
||||
XC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja.txt ق�4a
|
||||
XC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja.txt ‘•ѱ�4a
|
||||
_
|
||||
]C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build_file_index.txt Ù‚Ì�4� Äðò3b
|
||||
]C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build_file_index.txt ‘•ѱ�4� Äðò3b
|
||||
`
|
||||
^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json Ù‚Ì�4´à àÀðò3f
|
||||
^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json ‘•ѱ�4´à àÀðò3f
|
||||
d
|
||||
bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json.bin Ù‚Ì�4 ò„ àÀðò3l
|
||||
bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json.bin ‘•ѱ�4 ò„ àÀðò3l
|
||||
j
|
||||
hC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\metadata_generation_command.txt ق�4
|
||||
hC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\metadata_generation_command.txt ‘•ѱ�4
|
||||
Ä ŸÄðò3_
|
||||
]
|
||||
[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\prefab_config.json Ù‚Ì�4€ ŸÄðò3d
|
||||
[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\prefab_config.json ‘•ѱ�4€ ŸÄðò3d
|
||||
b
|
||||
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\symbol_folder_index.txt Ù‚Ì�4␍_ Äðò3{
|
||||
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\symbol_folder_index.txt ‘•ѱ�4␍_ Äðò3{
|
||||
y
|
||||
wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt Ù‚Ì�4␍¾ Ü…§ðò3v
|
||||
wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt ‘•ѱ�4␍¾ Ü…§ðò3v
|
||||
t
|
||||
rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt Ù‚Ì�4ö ùާðò3µ
|
||||
rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt ‘•ѱ�4ö ùާðò3µ
|
||||
²
|
||||
¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json Ù‚Ì�4Y
|
||||
¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json ‘•ѱ�4Y
|
||||
W
|
||||
UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt Ù‚Ì�4½ œ§ØÖç3u
|
||||
UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt ‘•ѱ�4½ œ§ØÖç3u
|
||||
s
|
||||
qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt Ù‚Ì�4ê ú„§ðò3t
|
||||
qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt ‘•ѱ�4ê ú„§ðò3t
|
||||
r
|
||||
pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt Ù‚Ì�4ê è„§ðò3³
|
||||
pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt ‘•ѱ�4ê è„§ðò3³
|
||||
°
|
||||
C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json ق�4k
|
||||
C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json ’•ѱ�4k
|
||||
i
|
||||
gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt Ù‚Ì�4ð ®¡ÈÑç3
|
||||
gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt ’•ѱ�4ð ®¡ÈÑç3
|
||||
@@ -92,8 +92,8 @@ android {
|
||||
applicationId 'de.orfel.schnappix'
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 27
|
||||
versionName "23.01.27"
|
||||
versionCode 31
|
||||
versionName "23.01.31"
|
||||
|
||||
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
"newArchEnabled": true,
|
||||
"name": "Schnappix",
|
||||
"slug": "Schnappix",
|
||||
"version": "23.01.27",
|
||||
"version": "23.01.31",
|
||||
"orientation": "landscape",
|
||||
"icon": "./Icon.png",
|
||||
"userInterfaceStyle": "dark",
|
||||
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"android": {
|
||||
"package": "de.orfel.schnappix",
|
||||
"versionCode": 27,
|
||||
"versionCode": 31,
|
||||
"usesCleartextTraffic": true,
|
||||
"adaptiveIcon": {
|
||||
"backgroundColor": "#050510",
|
||||
|
||||
@@ -3,13 +3,31 @@ package expo.modules.usbcamera
|
||||
import expo.modules.kotlin.modules.Module
|
||||
import expo.modules.kotlin.modules.ModuleDefinition
|
||||
import expo.modules.kotlin.Promise
|
||||
import java.io.BufferedReader
|
||||
import java.io.InputStreamReader
|
||||
|
||||
class UsbCameraModule : Module() {
|
||||
override fun definition() = ModuleDefinition {
|
||||
Name("UsbCamera")
|
||||
|
||||
AsyncFunction("getLogcat") { promise: Promise ->
|
||||
try {
|
||||
val process = Runtime.getRuntime().exec("logcat -d -v time -s UsbCameraView CameraClient")
|
||||
val bufferedReader = BufferedReader(InputStreamReader(process.inputStream))
|
||||
val log = java.lang.StringBuilder()
|
||||
var line: String? = bufferedReader.readLine()
|
||||
while (line != null) {
|
||||
log.append(line).append("\n")
|
||||
line = bufferedReader.readLine()
|
||||
}
|
||||
promise.resolve(log.toString())
|
||||
} catch (e: Exception) {
|
||||
promise.resolve("Error reading logcat: ${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
View(UsbCameraView::class) {
|
||||
Events("onCameraReady")
|
||||
Events("onCameraReady", "onCameraError", "onCameraState")
|
||||
|
||||
AsyncFunction("takePicture") { view: UsbCameraView, savePath: String, promise: Promise ->
|
||||
view.takePicture(savePath, promise)
|
||||
|
||||
@@ -12,10 +12,16 @@ import expo.modules.kotlin.views.ExpoView
|
||||
import expo.modules.kotlin.AppContext
|
||||
import expo.modules.kotlin.Promise
|
||||
|
||||
import expo.modules.kotlin.viewevent.EventDispatcher
|
||||
|
||||
class UsbCameraView(context: Context, appContext: AppContext) : ExpoView(context, appContext) {
|
||||
private val textureView: AspectRatioTextureView
|
||||
private var cameraClient: CameraClient? = null
|
||||
|
||||
private val onCameraReady by EventDispatcher()
|
||||
private val onCameraError by EventDispatcher()
|
||||
private val onCameraState by EventDispatcher()
|
||||
|
||||
init {
|
||||
textureView = AspectRatioTextureView(context)
|
||||
addView(textureView, LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT))
|
||||
@@ -89,8 +95,13 @@ class UsbCameraView(context: Context, appContext: AppContext) : ExpoView(context
|
||||
private fun startPreview() {
|
||||
try {
|
||||
cameraClient?.openCamera(textureView)
|
||||
onCameraReady(mapOf("status" to "ready"))
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
appContext.currentActivity?.runOnUiThread {
|
||||
android.util.Log.e("UsbCameraView", "startPreview error: ${e.message}")
|
||||
onCameraError(mapOf("error" to (e.message ?: "Unknown error")))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
import { requireNativeViewManager } from 'expo-modules-core';
|
||||
import { requireNativeViewManager, requireNativeModule } from 'expo-modules-core';
|
||||
import * as React from 'react';
|
||||
import { ViewProps, Platform } from 'react-native';
|
||||
|
||||
const viewName = 'UsbCamera';
|
||||
export const UsbCamera = requireNativeModule('UsbCamera');
|
||||
|
||||
export async function getUsbCameraLogcat(): Promise<string> {
|
||||
if (UsbCamera && UsbCamera.getLogcat) {
|
||||
return await UsbCamera.getLogcat();
|
||||
}
|
||||
return 'Not supported';
|
||||
}
|
||||
|
||||
export interface UsbCameraViewProps extends ViewProps {
|
||||
// Add props here if we decide to pass them from JS
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "schnappix",
|
||||
"version": "23.01.27",
|
||||
"version": "23.01.31",
|
||||
"main": "index.ts",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
||||
|
||||
@@ -37,7 +37,7 @@ import {
|
||||
faFaceSmile,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import { THEME } from '../styles/theme';
|
||||
import { UsbCameraView, UsbCameraRef } from '../../modules/usb-camera';
|
||||
import { UsbCameraView, UsbCameraRef, getUsbCameraLogcat } from '../../modules/usb-camera';
|
||||
import { saveToGallery } from '../services/storage';
|
||||
import FrameOverlay from '../components/FrameOverlay';
|
||||
import { FRAMES } from '../data/frames';
|
||||
@@ -178,9 +178,17 @@ export default function CameraScreen({
|
||||
try {
|
||||
if (usbCameraRef.current) {
|
||||
const connected = await usbCameraRef.current.isCameraConnected();
|
||||
if (connected !== isUsbConnected) {
|
||||
logger.log(`USB Connection status changed to: ${connected}`);
|
||||
if (!connected) {
|
||||
const logcat = await getUsbCameraLogcat();
|
||||
logger.error(`USB Camera disconnected or failed to connect. Logcat:\n${logcat}`);
|
||||
}
|
||||
}
|
||||
setIsUsbConnected(connected);
|
||||
}
|
||||
} catch (e) {
|
||||
logger.error('Error checking USB connection:', e);
|
||||
setIsUsbConnected(false);
|
||||
}
|
||||
};
|
||||
@@ -681,11 +689,19 @@ export default function CameraScreen({
|
||||
<>
|
||||
<UsbCameraView
|
||||
ref={usbCameraRef}
|
||||
style={
|
||||
isUsbConnected
|
||||
? StyleSheet.absoluteFill
|
||||
: { position: 'absolute', left: -9999, width: 1, height: 1 }
|
||||
}
|
||||
style={[
|
||||
StyleSheet.absoluteFill,
|
||||
!isUsbConnected && { zIndex: -1 }
|
||||
]}
|
||||
onCameraReady={() => {
|
||||
logger.log('USB Camera is fully ready.');
|
||||
}}
|
||||
onCameraError={(event: any) => {
|
||||
logger.error('USB Camera Error from Native:', event.nativeEvent);
|
||||
}}
|
||||
onCameraState={(event: any) => {
|
||||
logger.log(`USB Camera State: ${JSON.stringify(event.nativeEvent)}`);
|
||||
}}
|
||||
/>
|
||||
{!isUsbConnected && (
|
||||
useFrontCamera ? (
|
||||
|
||||
Reference in new issue
Block a user