11package com.threegap.bitnagil.presentation.emotion
22
33import androidx.activity.compose.BackHandler
4+ import androidx.compose.foundation.layout.BoxWithConstraints
5+ import androidx.compose.foundation.layout.fillMaxWidth
46import androidx.compose.runtime.Composable
57import androidx.compose.runtime.collectAsState
68import androidx.compose.runtime.getValue
79import androidx.compose.runtime.remember
10+ import androidx.compose.ui.Modifier
11+ import androidx.compose.ui.unit.dp
812import androidx.hilt.navigation.compose.hiltViewModel
13+ import com.threegap.bitnagil.presentation.common.dimension.pxToDp
914import com.threegap.bitnagil.presentation.common.flow.collectAsEffect
1015import com.threegap.bitnagil.presentation.common.toast.GlobalBitnagilToast
1116import com.threegap.bitnagil.presentation.emotion.component.template.EmotionRecommendRoutineScreen
17+ import com.threegap.bitnagil.presentation.emotion.component.template.SimpleEmotionSelectionScreen
1218import com.threegap.bitnagil.presentation.emotion.component.template.SwipeEmotionSelectionScreen
1319import com.threegap.bitnagil.presentation.emotion.model.EmotionScreenStep
1420import com.threegap.bitnagil.presentation.emotion.model.mvi.EmotionSideEffect
@@ -32,15 +38,27 @@ fun EmotionScreenContainer(
3238 }
3339
3440 when (state.step) {
35- EmotionScreenStep .Emotion -> SwipeEmotionSelectionScreen (
36- state = state,
37- onClickPreviousButton = navigateToBack,
38- onSelectEmotion = remember {
39- { emotionType ->
40- viewModel.selectEmotion(emotionType = emotionType, minimumDelay = 1000 )
41- }
42- },
43- )
41+ EmotionScreenStep .Emotion -> BoxWithConstraints (modifier = Modifier .fillMaxWidth()) {
42+ val height = constraints.maxHeight.pxToDp()
43+
44+ if (height > 600 .dp) {
45+ SwipeEmotionSelectionScreen (
46+ state = state,
47+ onClickPreviousButton = navigateToBack,
48+ onSelectEmotion = remember {
49+ { emotionType ->
50+ viewModel.selectEmotion(emotionType = emotionType, minimumDelay = 1000 )
51+ }
52+ },
53+ )
54+ } else {
55+ SimpleEmotionSelectionScreen (
56+ state = state,
57+ onClickPreviousButton = navigateToBack,
58+ onClickEmotion = viewModel::selectEmotion,
59+ )
60+ }
61+ }
4462 EmotionScreenStep .RecommendRoutines -> EmotionRecommendRoutineScreen (
4563 state = state,
4664 onClickRoutine = viewModel::selectRecommendRoutine,
0 commit comments