From e142b550639e44049f93a3bb70343829d57ce0a2 Mon Sep 17 00:00:00 2001 From: jjangddu Date: Thu, 2 Apr 2026 14:21:00 +0900 Subject: [PATCH] Fix camera screen: navigate via AppScreen instead of overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Camera was hidden behind PiezoMonitoringView because it was rendered as a child composable. Now uses AppScreen.URINE_CAMERA for full Crossfade navigation — camera gets its own screen transition. Flow: Catheterize → 카메라 → AppScreen.URINE_CAMERA → measure → back to PIEZO_MONITORING Co-Authored-By: Claude Opus 4.6 (1M context) --- .../com/example/medilightv2android/AppState.kt | 3 ++- .../example/medilightv2android/MainActivity.kt | 8 ++++++++ .../ui/views/monitoring/PiezoMonitoringView.kt | 15 ++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/example/medilightv2android/AppState.kt b/app/src/main/java/com/example/medilightv2android/AppState.kt index addd447..0891154 100644 --- a/app/src/main/java/com/example/medilightv2android/AppState.kt +++ b/app/src/main/java/com/example/medilightv2android/AppState.kt @@ -14,7 +14,8 @@ enum class AppScreen { ONBOARDING, REGISTRATION, HOME, SENSOR_SELECT, DEVICE_SCAN, NIRS_CALIBRATION, PIEZO_PERSONALIZATION, PIN_SETUP, PIN_ENTRY, VIVAMYO_MONITORING, PIEZO_MONITORING, MEASUREMENT_HISTORY, - VOIDING_DIARY + VOIDING_DIARY, + URINE_CAMERA } class AppState(private val context: Context) { diff --git a/app/src/main/java/com/example/medilightv2android/MainActivity.kt b/app/src/main/java/com/example/medilightv2android/MainActivity.kt index 587c869..3121541 100644 --- a/app/src/main/java/com/example/medilightv2android/MainActivity.kt +++ b/app/src/main/java/com/example/medilightv2android/MainActivity.kt @@ -23,6 +23,7 @@ import com.example.medilightv2android.ui.views.history.MeasurementHistoryView import com.example.medilightv2android.ui.views.home.HomeView import com.example.medilightv2android.ui.views.monitoring.PiezoMonitoringView import com.example.medilightv2android.ui.views.monitoring.VivamyoMonitoringView +import com.example.medilightv2android.ui.views.monitoring.UrineCameraScreen import com.example.medilightv2android.ui.views.monitoring.VoidingDiaryView import com.example.medilightv2android.ui.views.onboarding.OnboardingView import com.example.medilightv2android.ui.views.personalization.PiezoPersonalizationView @@ -76,6 +77,13 @@ fun MedilightApp(modifier: Modifier = Modifier) { AppScreen.PIEZO_MONITORING -> PiezoMonitoringView(appState) AppScreen.MEASUREMENT_HISTORY -> MeasurementHistoryView(appState) AppScreen.VOIDING_DIARY -> VoidingDiaryView(onBack = { appState.currentScreen = AppScreen.HOME }) + AppScreen.URINE_CAMERA -> UrineCameraScreen( + onDone = { volume -> + if (volume != null && volume > 0) appState.resetLevel() + appState.currentScreen = AppScreen.PIEZO_MONITORING + }, + onCancel = { appState.currentScreen = AppScreen.PIEZO_MONITORING } + ) } } } \ No newline at end of file diff --git a/app/src/main/java/com/example/medilightv2android/ui/views/monitoring/PiezoMonitoringView.kt b/app/src/main/java/com/example/medilightv2android/ui/views/monitoring/PiezoMonitoringView.kt index 4f6958b..bc4945f 100644 --- a/app/src/main/java/com/example/medilightv2android/ui/views/monitoring/PiezoMonitoringView.kt +++ b/app/src/main/java/com/example/medilightv2android/ui/views/monitoring/PiezoMonitoringView.kt @@ -250,15 +250,12 @@ fun PiezoMonitoringView(appState: AppState) { ) } - // 소변컵 카메라 촬영 화면 (풀스크린 오버레이) - if (showUrineCamera) { - UrineCameraScreen( - onDone = { volume -> - showUrineCamera = false - if (volume != null && volume > 0) appState.resetLevel() - }, - onCancel = { showUrineCamera = false } - ) + // 카메라 → AppScreen으로 전환 + LaunchedEffect(showUrineCamera) { + if (showUrineCamera) { + showUrineCamera = false + appState.currentScreen = AppScreen.URINE_CAMERA + } } Column(