File tree Expand file tree Collapse file tree
app/src/main/java/com/threegap/bitnagil
presentation/src/main/java/com/threegap/bitnagil/presentation/home Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import com.threegap.bitnagil.presentation.login.LoginScreenContainer
1212import com.threegap.bitnagil.presentation.onboarding.OnBoardingScreenContainer
1313import com.threegap.bitnagil.presentation.onboarding.OnBoardingViewModel
1414import com.threegap.bitnagil.presentation.onboarding.model.navarg.OnBoardingScreenArg
15+ import com.threegap.bitnagil.presentation.routinelist.RoutineListScreenContainer
1516import com.threegap.bitnagil.presentation.setting.SettingScreenContainer
1617import com.threegap.bitnagil.presentation.splash.SplashScreenContainer
1718import com.threegap.bitnagil.presentation.terms.TermsAgreementScreenContainer
@@ -118,6 +119,13 @@ fun MainNavHost(
118119 navigateToEmotion = {
119120 navigator.navController.navigate(Route .Emotion )
120121 },
122+ navigateToRoutineList = { selectedDate ->
123+ navigator.navController.navigate(
124+ Route .RoutineList (selectedDate = selectedDate)
125+ ) {
126+ launchSingleTop = true
127+ }
128+ }
121129 )
122130 }
123131
@@ -241,5 +249,15 @@ fun MainNavHost(
241249 },
242250 )
243251 }
252+
253+ composable<Route .RoutineList > {
254+ RoutineListScreenContainer (
255+ navigateToBack = {
256+ if (navigator.navController.previousBackStackEntry != null ) {
257+ navigator.navController.popBackStack()
258+ }
259+ },
260+ )
261+ }
244262 }
245263}
Original file line number Diff line number Diff line change @@ -41,4 +41,7 @@ sealed interface Route {
4141
4242 @Serializable
4343 data object Withdrawal : Route
44+
45+ @Serializable
46+ data class RoutineList (val selectedDate : String ) : Route
4447}
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ fun HomeNavHost(
4141 navigateToQnA : () -> Unit ,
4242 navigateToRegisterRoutine : (String? ) -> Unit ,
4343 navigateToEmotion : () -> Unit ,
44+ navigateToRoutineList : (String ) -> Unit ,
4445) {
4546 val navigator = rememberHomeNavigator()
4647 var showFloatingOverlay by remember { mutableStateOf(false ) }
@@ -66,6 +67,9 @@ fun HomeNavHost(
6667 navigateToRegisterRoutine(null )
6768 },
6869 navigateToEmotion = navigateToEmotion,
70+ navigateToRoutineList = { selectedDate ->
71+ navigateToRoutineList(selectedDate)
72+ },
6973 )
7074 }
7175
Original file line number Diff line number Diff line change @@ -39,9 +39,10 @@ import java.time.LocalDate
3939
4040@Composable
4141fun HomeScreenContainer (
42- viewModel : HomeViewModel = hiltViewModel(),
4342 navigateToRegisterRoutine : () -> Unit ,
4443 navigateToEmotion : () -> Unit ,
44+ navigateToRoutineList : (String ) -> Unit ,
45+ viewModel : HomeViewModel = hiltViewModel(),
4546) {
4647 val uiState by viewModel.stateFlow.collectAsStateWithLifecycle()
4748
@@ -55,6 +56,10 @@ fun HomeScreenContainer(
5556 navigateToEmotion()
5657 }
5758
59+ is HomeSideEffect .NavigateToRoutineList -> {
60+ navigateToRoutineList(sideEffect.selectedDate)
61+ }
62+
5863 is HomeSideEffect .ShowToastWithIcon -> {
5964 GlobalBitnagilToast .showCheck(sideEffect.message)
6065 }
@@ -89,7 +94,7 @@ fun HomeScreenContainer(
8994 viewModel.sendIntent(HomeIntent .OnRegisterEmotionClick )
9095 },
9196 onShowMoreRoutinesClick = {
92- // TODO: 루틴 리스트 화면으로 이동
97+ viewModel.sendIntent(( HomeIntent . OnShowMoreRoutinesClick ))
9398 },
9499 )
95100}
Original file line number Diff line number Diff line change @@ -120,6 +120,12 @@ class HomeViewModel @Inject constructor(
120120 null
121121 }
122122
123+ is HomeIntent .OnShowMoreRoutinesClick -> {
124+ val selectedDate = container.stateFlow.value.selectedDate.toString()
125+ sendSideEffect(HomeSideEffect .NavigateToRoutineList (selectedDate))
126+ null
127+ }
128+
123129 is HomeIntent .RoutineToggleCompletionFailure -> {
124130 sendSideEffect(HomeSideEffect .ShowToast (" 루틴 완료 상태 저장에 실패했어요.\n 다시 시도해 주세요." ))
125131 null
Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ sealed class HomeIntent : MviIntent {
1616 data object OnRegisterRoutineClick : HomeIntent ()
1717 data object OnPreviousWeekClick : HomeIntent ()
1818 data object OnNextWeekClick : HomeIntent ()
19+ data object OnShowMoreRoutinesClick : HomeIntent ()
1920}
Original file line number Diff line number Diff line change @@ -7,4 +7,5 @@ sealed interface HomeSideEffect : MviSideEffect {
77 data class ShowToastWithIcon (val message : String ) : HomeSideEffect
88 data object NavigateToRegisterRoutine : HomeSideEffect
99 data object NavigateToEmotion : HomeSideEffect
10+ data class NavigateToRoutineList (val selectedDate : String ) : HomeSideEffect
1011}
You can’t perform that action at this time.
0 commit comments