From 5cc542ff7a3b9833027110af30d180f282dc3426 Mon Sep 17 00:00:00 2001 From: jinuemong Date: Thu, 25 Jan 2024 14:42:21 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]:=20Preview=20=EC=B6=94=EA=B0=80=20&=20nam?= =?UTF-8?q?ing=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RegistrationCollectingDestination.kt | 2 +- .../RegistrationCollectingScreen.kt | 19 ++++++++++++++++++- .../naming/RegistrationNamingScreen.kt | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/collecting/RegistrationCollectingDestination.kt b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/collecting/RegistrationCollectingDestination.kt index 39a6fb5a..22d7b2dd 100644 --- a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/collecting/RegistrationCollectingDestination.kt +++ b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/collecting/RegistrationCollectingDestination.kt @@ -31,7 +31,7 @@ fun NavGraphBuilder.registrationCollectingDestination( ErrorObserver(viewModel) - RegistrationNamingScreen( + RegistrationCollectingScreen( appState = appState, model = model, event = viewModel.event, diff --git a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/collecting/RegistrationCollectingScreen.kt b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/collecting/RegistrationCollectingScreen.kt index 6e056e44..504e8cf9 100644 --- a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/collecting/RegistrationCollectingScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/collecting/RegistrationCollectingScreen.kt @@ -2,8 +2,10 @@ package ac.dnd.bookkeeping.android.presentation.ui.main.registration.collecting import ac.dnd.bookkeeping.android.presentation.common.util.LaunchedEffectWithLifecycle import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.EventFlow +import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.bookkeeping.android.presentation.ui.main.ApplicationState import ac.dnd.bookkeeping.android.presentation.ui.main.home.HomeConstant +import ac.dnd.bookkeeping.android.presentation.ui.main.rememberApplicationState import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box @@ -18,13 +20,14 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.flow.collectLatest @Composable -fun RegistrationNamingScreen( +fun RegistrationCollectingScreen( appState: ApplicationState, model: RegistrationCollectingModel, event: EventFlow, @@ -78,3 +81,17 @@ fun RegistrationNamingScreen( } } } + +@Preview +@Composable +fun RegistrationCollectingScreenPreview() { + RegistrationCollectingScreen( + appState = rememberApplicationState(), + model = RegistrationCollectingModel( + state = RegistrationCollectingState.Init + ), + event = MutableEventFlow(), + intent = {}, + handler = CoroutineExceptionHandler { _, _ -> } + ) +} diff --git a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/naming/RegistrationNamingScreen.kt b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/naming/RegistrationNamingScreen.kt index 3c32995a..d332186e 100644 --- a/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/naming/RegistrationNamingScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/registration/naming/RegistrationNamingScreen.kt @@ -2,8 +2,10 @@ package ac.dnd.bookkeeping.android.presentation.ui.main.registration.naming import ac.dnd.bookkeeping.android.presentation.common.util.LaunchedEffectWithLifecycle import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.EventFlow +import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.bookkeeping.android.presentation.ui.main.ApplicationState import ac.dnd.bookkeeping.android.presentation.ui.main.registration.collecting.RegistrationCollectingConstant +import ac.dnd.bookkeeping.android.presentation.ui.main.rememberApplicationState import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box @@ -18,6 +20,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import kotlinx.coroutines.CoroutineExceptionHandler @@ -74,3 +77,17 @@ fun RegistrationNamingScreen( } } } + +@Preview +@Composable +fun RegistrationNamingScreenPreview() { + RegistrationNamingScreen( + appState = rememberApplicationState(), + model = RegistrationNamingModel( + state = RegistrationNamingState.Init + ), + event = MutableEventFlow(), + intent = {}, + handler = CoroutineExceptionHandler { _, _ -> } + ) +}