Propagate camera binding errors to UI
Add an error StateFlow to CameraManager so camera binding failures are surfaced to the user instead of silently swallowed by e.printStackTrace(). CameraScreen collects this flow and displays errors using the existing red overlay UI. Added Log.e with proper TAG for logcat visibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f0249fcd64
commit
6ed3e8e7b5
2 changed files with 25 additions and 2 deletions
|
|
@ -104,6 +104,17 @@ fun CameraScreen(
|
|||
val minZoom by cameraManager.minZoomRatio.collectAsState()
|
||||
val maxZoom by cameraManager.maxZoomRatio.collectAsState()
|
||||
val isFrontCamera by cameraManager.isFrontCamera.collectAsState()
|
||||
val cameraError by cameraManager.error.collectAsState()
|
||||
|
||||
// Show camera errors via the existing error UI
|
||||
LaunchedEffect(cameraError) {
|
||||
cameraError?.let { message ->
|
||||
showSaveError = message
|
||||
cameraManager.clearError()
|
||||
delay(2000)
|
||||
showSaveError = null
|
||||
}
|
||||
}
|
||||
|
||||
// Collect orientation updates
|
||||
LaunchedEffect(Unit) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue