diff --git a/app/src/main/java/com/threegap/bitnagil/MainNavHost.kt b/app/src/main/java/com/threegap/bitnagil/MainNavHost.kt index eaf72d83..d80369e0 100644 --- a/app/src/main/java/com/threegap/bitnagil/MainNavHost.kt +++ b/app/src/main/java/com/threegap/bitnagil/MainNavHost.kt @@ -80,7 +80,9 @@ fun MainNavHost( ) }, navigateToOnBoarding = { - navigator.navController.navigate(Route.OnBoarding()) + navigator.navController.navigate(Route.OnBoarding()) { + popUpTo(0) { inclusive = true } + } }, navigateToBack = { if (navigator.navController.previousBackStackEntry != null) { diff --git a/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilSelectButton.kt b/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilSelectButton.kt index 8d607125..9d3885a6 100644 --- a/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilSelectButton.kt +++ b/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilSelectButton.kt @@ -29,6 +29,7 @@ import androidx.compose.ui.semantics.Role import androidx.compose.ui.semantics.role import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.style.LineHeightStyle import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.threegap.bitnagil.designsystem.BitnagilTheme @@ -93,7 +94,12 @@ fun BitnagilSelectButton( Text( text = title, color = contentColor, - style = titleTextStyle, + style = titleTextStyle.copy( + lineHeightStyle = LineHeightStyle( + alignment = LineHeightStyle.Alignment.Center, + trim = LineHeightStyle.Trim.None, + ), + ), ) description?.let { diff --git a/core/designsystem/src/main/res/drawable-hdpi/img_list_guide.png b/core/designsystem/src/main/res/drawable-hdpi/img_list_guide.png new file mode 100644 index 00000000..5de0c282 Binary files /dev/null and b/core/designsystem/src/main/res/drawable-hdpi/img_list_guide.png differ diff --git a/core/designsystem/src/main/res/drawable-mdpi/img_list_guide.png b/core/designsystem/src/main/res/drawable-mdpi/img_list_guide.png new file mode 100644 index 00000000..52389f66 Binary files /dev/null and b/core/designsystem/src/main/res/drawable-mdpi/img_list_guide.png differ diff --git a/core/designsystem/src/main/res/drawable-xhdpi/img_list_guide.png b/core/designsystem/src/main/res/drawable-xhdpi/img_list_guide.png new file mode 100644 index 00000000..945261f3 Binary files /dev/null and b/core/designsystem/src/main/res/drawable-xhdpi/img_list_guide.png differ diff --git a/core/designsystem/src/main/res/drawable-xxhdpi/img_list_guide.png b/core/designsystem/src/main/res/drawable-xxhdpi/img_list_guide.png new file mode 100644 index 00000000..e10d95f8 Binary files /dev/null and b/core/designsystem/src/main/res/drawable-xxhdpi/img_list_guide.png differ diff --git a/core/designsystem/src/main/res/drawable-xxxhdpi/img_list_guide.png b/core/designsystem/src/main/res/drawable-xxxhdpi/img_list_guide.png new file mode 100644 index 00000000..f6060055 Binary files /dev/null and b/core/designsystem/src/main/res/drawable-xxxhdpi/img_list_guide.png differ diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/guide/model/GuideType.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/guide/model/GuideType.kt index 40bec3b6..f7233621 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/guide/model/GuideType.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/guide/model/GuideType.kt @@ -13,6 +13,11 @@ enum class GuideType( description = "오늘 느끼는 감정을 선택하면, 그 기분에 맞춰 추천 루틴을 확인할 수 있어요.", image = R.drawable.img_register_guide, ), + HOME_LIST( + title = "홈에서 더보기란?", + description = "루틴리스트에서 세부 항목(세부루틴, 반복, 기간, 시간)을\n확인하고, 필요 시 수정하거나 삭제할 수 있어요.", + image = R.drawable.img_list_guide, + ), RECOMMEND( title = "맞춤 추천 루틴이란?", description = "처음 설정한 목표에 맞춰 루틴을 추천받을 수 있으며,\n필요할 때 언제든 수정할 수 있어요.", diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/recommendroutine/RecommendRoutineViewModel.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/recommendroutine/RecommendRoutineViewModel.kt index ed137d7b..86a04932 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/recommendroutine/RecommendRoutineViewModel.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/recommendroutine/RecommendRoutineViewModel.kt @@ -2,6 +2,7 @@ package com.threegap.bitnagil.presentation.recommendroutine import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.viewModelScope +import com.threegap.bitnagil.domain.emotion.usecase.GetEmotionChangeEventFlowUseCase import com.threegap.bitnagil.domain.recommendroutine.model.RecommendCategory import com.threegap.bitnagil.domain.recommendroutine.model.RecommendLevel import com.threegap.bitnagil.domain.recommendroutine.usecase.FetchRecommendRoutinesUseCase @@ -21,6 +22,7 @@ import javax.inject.Inject class RecommendRoutineViewModel @Inject constructor( savedStateHandle: SavedStateHandle, private val fetchRecommendRoutinesUseCase: FetchRecommendRoutinesUseCase, + private val getEmotionChangeEventFlowUseCase: GetEmotionChangeEventFlowUseCase, ) : MviViewModel( initState = RecommendRoutineState(), savedStateHandle = savedStateHandle, @@ -28,6 +30,7 @@ class RecommendRoutineViewModel @Inject constructor( init { loadRecommendRoutines() + observeEmotionChangeEvent() } private var recommendRoutines: RecommendRoutinesUiModel = RecommendRoutinesUiModel() @@ -90,6 +93,14 @@ class RecommendRoutineViewModel @Inject constructor( } } + private fun observeEmotionChangeEvent() { + viewModelScope.launch { + getEmotionChangeEventFlowUseCase().collect { + loadRecommendRoutines() + } + } + } + private fun loadRecommendRoutines() { sendIntent(RecommendRoutineIntent.UpdateLoading(true)) viewModelScope.launch { diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineScreen.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineScreen.kt index 4a681f97..ba445a51 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineScreen.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineScreen.kt @@ -29,6 +29,7 @@ import com.threegap.bitnagil.designsystem.R import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButton import com.threegap.bitnagil.designsystem.component.block.BitnagilTopBar import com.threegap.bitnagil.presentation.common.flow.collectAsEffect +import com.threegap.bitnagil.presentation.common.toast.GlobalBitnagilToast import com.threegap.bitnagil.presentation.writeroutine.component.atom.namefield.NameField import com.threegap.bitnagil.presentation.writeroutine.component.atom.selectcell.SelectCell import com.threegap.bitnagil.presentation.writeroutine.component.atom.writeroutinebutton.WriteRoutineButton @@ -57,6 +58,10 @@ fun WriteRoutineScreenContainer( WriteRoutineSideEffect.MoveToPreviousScreen -> { navigateToBack() } + + is WriteRoutineSideEffect.ShowToast -> { + GlobalBitnagilToast.showCheck(sideEffect.message) + } } } diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt index 910dd6f8..304cba68 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/WriteRoutineViewModel.kt @@ -203,6 +203,7 @@ class WriteRoutineViewModel @AssistedInject constructor( } WriteRoutineIntent.EditRoutineSuccess -> { sendSideEffect(WriteRoutineSideEffect.MoveToPreviousScreen) + sendSideEffect(WriteRoutineSideEffect.ShowToast("루틴 수정이 완료되었습니다.")) return state.copy( loading = false, diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/mvi/WriteRoutineSideEffect.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/mvi/WriteRoutineSideEffect.kt index bd40e601..ca5c12a6 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/mvi/WriteRoutineSideEffect.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/mvi/WriteRoutineSideEffect.kt @@ -4,4 +4,5 @@ import com.threegap.bitnagil.presentation.common.mviviewmodel.MviSideEffect sealed class WriteRoutineSideEffect : MviSideEffect { data object MoveToPreviousScreen : WriteRoutineSideEffect() + data class ShowToast(val message: String) : WriteRoutineSideEffect() }