Skip to content

Commit 1bd2fc6

Browse files
committed
[BOOK-206] feat: EmotionStep에 감정 그래픽 적용
1 parent 44805e4 commit 1bd2fc6

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/EmotionTag.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import com.ninecraft.booket.core.designsystem.theme.WarmthBgColor
1111
import com.ninecraft.booket.core.designsystem.theme.WarmthTextColor
1212

1313
enum class EmotionTag(val label: String, val bgColor: Color, val textColor: Color, val graphic: Int) {
14-
WARMTH("따뜻함", WarmthBgColor, WarmthTextColor, 0),
15-
JOY("즐거움", JoyBgColor, JoyTextColor, 0),
16-
TENSION("긴장감", TensionBgColor, TensionTextColor, 0),
17-
SADNESS("슬픔", SadnessBgColor, SadnessTextColor, 0),
14+
WARMTH("따뜻함", WarmthBgColor, WarmthTextColor, R.drawable.img_emotion_warmth),
15+
JOY("즐거움", JoyBgColor, JoyTextColor, R.drawable.img_emotion_joy),
16+
TENSION("긴장감", TensionBgColor, TensionTextColor, R.drawable.img_emotion_tension),
17+
SADNESS("슬픔", SadnessBgColor, SadnessTextColor, R.drawable.img_emotion_sadness),
1818
}
628 KB
Loading
619 KB
Loading
577 KB
Loading
623 KB
Loading

feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package com.ninecraft.booket.feature.record.step
22

33
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.border
45
import androidx.compose.foundation.layout.Arrangement
56
import androidx.compose.foundation.layout.Box
67
import androidx.compose.foundation.layout.Column
78
import androidx.compose.foundation.layout.Spacer
9+
import androidx.compose.foundation.layout.fillMaxSize
810
import androidx.compose.foundation.layout.height
911
import androidx.compose.foundation.layout.padding
1012
import androidx.compose.foundation.lazy.grid.GridCells
@@ -16,11 +18,13 @@ import androidx.compose.runtime.Composable
1618
import androidx.compose.ui.Alignment
1719
import androidx.compose.ui.Modifier
1820
import androidx.compose.ui.draw.clip
21+
import androidx.compose.ui.layout.ContentScale
1922
import androidx.compose.ui.res.stringResource
2023
import androidx.compose.ui.unit.dp
2124
import com.ninecraft.booket.core.common.extensions.clickableSingle
2225
import com.ninecraft.booket.core.designsystem.ComponentPreview
2326
import com.ninecraft.booket.core.designsystem.EmotionTag
27+
import com.ninecraft.booket.core.designsystem.component.ResourceImage
2428
import com.ninecraft.booket.core.designsystem.theme.ReedTheme
2529
import com.ninecraft.booket.core.designsystem.theme.White
2630
import com.ninecraft.booket.feature.record.R
@@ -75,22 +79,33 @@ private fun EmotionItem(
7579
onClick: () -> Unit,
7680
isSelected: Boolean,
7781
) {
78-
val bgColor = if (isSelected) ReedTheme.colors.bgTertiary else ReedTheme.colors.bgSecondary
79-
8082
Box(
8183
modifier = Modifier
8284
.height(214.dp)
8385
.background(
84-
color = bgColor,
86+
color = ReedTheme.colors.bgTertiary,
8587
shape = RoundedCornerShape(ReedTheme.radius.md),
8688
)
89+
.then(
90+
if (isSelected) Modifier.border(
91+
width = 2.dp,
92+
color = ReedTheme.colors.borderBrand,
93+
shape = RoundedCornerShape(ReedTheme.radius.md),
94+
)
95+
else Modifier,
96+
)
8797
.clip(RoundedCornerShape(ReedTheme.radius.md))
8898
.clickableSingle {
8999
onClick()
90100
},
91101
contentAlignment = Alignment.Center,
92102
) {
93-
Text(text = emotionTag.label)
103+
ResourceImage(
104+
imageRes = emotionTag.graphic,
105+
contentDescription = "Emotion Image",
106+
modifier = Modifier.fillMaxSize(),
107+
contentScale = ContentScale.Crop,
108+
)
94109
}
95110
}
96111

0 commit comments

Comments
 (0)