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(