Skip to content

Commit ca58fc2

Browse files
authored
Merge pull request #106 from YAPP-Github/feature/#90-home-redesign
[Feature/#90] 홈 화면 리디자인 변경 사항을 반영합니다.
2 parents ee1fd47 + 17600db commit ca58fc2

File tree

71 files changed

+779
-2037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+779
-2037
lines changed

app/src/main/java/com/threegap/bitnagil/MainNavHost.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ fun MainNavHost(
115115
navigateToRegisterRoutine = { routineId ->
116116
navigator.navController.navigate(Route.WriteRoutine(routineId = routineId))
117117
},
118-
navigateToEditRoutine = { routineId ->
119-
navigator.navController.navigate(Route.WriteRoutine(routineId = routineId, isRegister = false))
120-
},
121118
navigateToEmotion = {
122119
navigator.navController.navigate(Route.Emotion)
123120
},

app/src/main/java/com/threegap/bitnagil/navigation/home/HomeNavHost.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ fun HomeNavHost(
4040
navigateToNotice: () -> Unit,
4141
navigateToQnA: () -> Unit,
4242
navigateToRegisterRoutine: (String?) -> Unit,
43-
navigateToEditRoutine: (String) -> Unit,
4443
navigateToEmotion: () -> Unit,
4544
) {
4645
val navigator = rememberHomeNavigator()
@@ -66,7 +65,6 @@ fun HomeNavHost(
6665
navigateToRegisterRoutine = {
6766
navigateToRegisterRoutine(null)
6867
},
69-
navigateToEditRoutine = navigateToEditRoutine,
7068
navigateToEmotion = navigateToEmotion,
7169
)
7270
}
@@ -102,11 +100,6 @@ fun HomeNavHost(
102100

103101
BitnagilFloatingActionMenu(
104102
actions = listOf(
105-
FloatingActionItem(
106-
icon = R.drawable.ic_report,
107-
text = "제보하기",
108-
onClick = { GlobalBitnagilToast.showWarning("제보하기 기능은 추후 제공될 예정입니다.") },
109-
),
110103
FloatingActionItem(
111104
icon = R.drawable.ic_routine_add,
112105
text = "루틴 등록",

core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilFloatingButton.kt

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import androidx.compose.animation.scaleIn
1010
import androidx.compose.animation.scaleOut
1111
import androidx.compose.animation.slideInVertically
1212
import androidx.compose.animation.slideOutVertically
13-
import androidx.compose.foundation.Image
1413
import androidx.compose.foundation.background
1514
import androidx.compose.foundation.layout.Arrangement
1615
import androidx.compose.foundation.layout.Box
@@ -22,13 +21,12 @@ import androidx.compose.foundation.shape.CircleShape
2221
import androidx.compose.foundation.shape.RoundedCornerShape
2322
import androidx.compose.material3.Text
2423
import androidx.compose.runtime.Composable
24+
import androidx.compose.runtime.Immutable
2525
import androidx.compose.runtime.getValue
2626
import androidx.compose.ui.Alignment
2727
import androidx.compose.ui.Modifier
2828
import androidx.compose.ui.draw.scale
29-
import androidx.compose.ui.graphics.ColorFilter
30-
import androidx.compose.ui.graphics.vector.ImageVector
31-
import androidx.compose.ui.res.vectorResource
29+
import androidx.compose.ui.graphics.Color
3230
import androidx.compose.ui.tooling.preview.Preview
3331
import androidx.compose.ui.unit.dp
3432
import com.threegap.bitnagil.designsystem.BitnagilTheme
@@ -40,22 +38,22 @@ fun BitnagilFloatingButton(
4038
@DrawableRes id: Int,
4139
onClick: () -> Unit,
4240
modifier: Modifier = Modifier,
41+
isActive: Boolean = false,
42+
colors: BitnagilFloatingButtonColor = BitnagilFloatingButtonColor.default(),
4343
) {
4444
Box(
4545
contentAlignment = Alignment.Center,
4646
modifier = modifier
4747
.background(
48-
color = BitnagilTheme.colors.navy500,
48+
color = if (isActive) colors.activeIconBackgroundColor else colors.defaultIconBackgroundColor,
4949
shape = CircleShape,
5050
)
5151
.size(52.dp)
5252
.clickableWithoutRipple { onClick() },
5353
) {
54-
Image(
55-
imageVector = ImageVector.vectorResource(id),
56-
contentDescription = null,
57-
colorFilter = ColorFilter.tint(BitnagilTheme.colors.white),
58-
modifier = Modifier.size(24.dp),
54+
BitnagilIcon(
55+
id = id,
56+
tint = if (isActive) colors.activeIconColor else colors.defaultIconColor,
5957
)
6058
}
6159
}
@@ -66,8 +64,9 @@ fun BitnagilFloatingActionMenu(
6664
isExpanded: Boolean,
6765
onToggle: (Boolean) -> Unit,
6866
modifier: Modifier = Modifier,
69-
@DrawableRes defaultIcon: Int = R.drawable.ic_plus,
67+
@DrawableRes defaultIcon: Int = R.drawable.ic_add,
7068
@DrawableRes activeIcon: Int = R.drawable.ic_close,
69+
colors: BitnagilFloatingButtonColor = BitnagilFloatingButtonColor.default(),
7170
) {
7271
Box(modifier = modifier) {
7372
AnimatedVisibility(
@@ -102,7 +101,7 @@ fun BitnagilFloatingActionMenu(
102101
),
103102
) {
104103
Column(
105-
modifier = Modifier.padding(vertical = 16.dp, horizontal = 22.dp),
104+
modifier = Modifier.padding(16.dp),
106105
verticalArrangement = Arrangement.spacedBy(24.dp),
107106
) {
108107
actions.forEach { action ->
@@ -125,6 +124,8 @@ fun BitnagilFloatingActionMenu(
125124
BitnagilFloatingButton(
126125
id = if (isExpanded) activeIcon else defaultIcon,
127126
onClick = { onToggle(!isExpanded) },
127+
isActive = isExpanded,
128+
colors = colors,
128129
)
129130
}
130131
}
@@ -136,6 +137,24 @@ data class FloatingActionItem(
136137
val onClick: () -> Unit,
137138
)
138139

140+
@Immutable
141+
data class BitnagilFloatingButtonColor(
142+
val defaultIconColor: Color,
143+
val defaultIconBackgroundColor: Color,
144+
val activeIconColor: Color,
145+
val activeIconBackgroundColor: Color,
146+
) {
147+
companion object {
148+
@Composable
149+
fun default() = BitnagilFloatingButtonColor(
150+
defaultIconColor = BitnagilTheme.colors.white,
151+
defaultIconBackgroundColor = BitnagilTheme.colors.orange500,
152+
activeIconColor = BitnagilTheme.colors.coolGray30,
153+
activeIconBackgroundColor = BitnagilTheme.colors.white,
154+
)
155+
}
156+
}
157+
139158
@Composable
140159
private fun FloatingActionMenuItem(
141160
@DrawableRes icon: Int,
@@ -159,12 +178,13 @@ private fun FloatingActionMenuItem(
159178
BitnagilIcon(
160179
id = icon,
161180
tint = null,
181+
modifier = Modifier.size(24.dp),
162182
)
163183

164184
Text(
165185
text = text,
166-
style = BitnagilTheme.typography.subtitle1Medium,
167-
color = BitnagilTheme.colors.navy500,
186+
style = BitnagilTheme.typography.body2Medium,
187+
color = BitnagilTheme.colors.coolGray30,
168188
)
169189
}
170190
}
@@ -174,17 +194,12 @@ private fun FloatingActionMenuItem(
174194
private fun BitnagilFloatingButtonPreview() {
175195
Column {
176196
BitnagilFloatingButton(
177-
id = R.drawable.ic_plus,
197+
id = R.drawable.ic_add,
178198
onClick = {},
179199
)
180200

181201
BitnagilFloatingActionMenu(
182202
actions = listOf(
183-
FloatingActionItem(
184-
icon = R.drawable.ic_report,
185-
text = "제보하기",
186-
onClick = {},
187-
),
188203
FloatingActionItem(
189204
icon = R.drawable.ic_routine_add,
190205
text = "루틴 등록",

core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilTextButton.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
66
import androidx.compose.foundation.interaction.collectIsPressedAsState
77
import androidx.compose.foundation.layout.Box
88
import androidx.compose.foundation.layout.Column
9+
import androidx.compose.foundation.layout.PaddingValues
910
import androidx.compose.foundation.layout.Spacer
1011
import androidx.compose.foundation.layout.fillMaxWidth
1112
import androidx.compose.foundation.layout.height
@@ -40,6 +41,7 @@ fun BitnagilTextButton(
4041
shape: Shape = RoundedCornerShape(12.dp),
4142
textStyle: TextStyle = BitnagilTheme.typography.body1SemiBold,
4243
textDecoration: TextDecoration? = null,
44+
textPadding: PaddingValues = PaddingValues(0.dp),
4345
) {
4446
val interactionSource = remember { MutableInteractionSource() }
4547
val isPressed by interactionSource.collectIsPressedAsState()
@@ -77,6 +79,7 @@ fun BitnagilTextButton(
7779
color = textColor,
7880
style = textStyle,
7981
textDecoration = textDecoration,
82+
modifier = Modifier.padding(textPadding),
8083
)
8184
}
8285
}

core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/typography/Type.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ class BitnagilTypography internal constructor(
9797
private val _cafe24SsurroundAir: BitnagilTextStyle = BitnagilTextStyle(
9898
fontFamily = cafe24SsurroundAir,
9999
fontWeight = FontWeight.Light,
100-
fontSize = 24,
101-
lineHeight = 36,
100+
fontSize = 20,
101+
lineHeight = 30,
102102
letterSpacing = (-0.5f),
103103
),
104104
) {
15 KB
Loading
8.8 KB
Loading
22.8 KB
Loading
40.5 KB
Loading
61.7 KB
Loading

0 commit comments

Comments
 (0)