Skip to content

Commit 0efc9e6

Browse files
committed
[BOOK-150] feat: BottomNavigation 구성
1 parent 2a1d642 commit 0efc9e6

File tree

12 files changed

+83
-93
lines changed

12 files changed

+83
-93
lines changed

feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/component/MainBottomBar.kt

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ import androidx.compose.foundation.layout.fillMaxWidth
1212
import androidx.compose.foundation.layout.height
1313
import androidx.compose.foundation.layout.navigationBarsPadding
1414
import androidx.compose.foundation.selection.selectable
15-
import androidx.compose.material3.HorizontalDivider
15+
import androidx.compose.foundation.shape.RoundedCornerShape
1616
import androidx.compose.material3.Icon
1717
import androidx.compose.material3.Text
1818
import androidx.compose.runtime.Composable
1919
import androidx.compose.runtime.remember
2020
import androidx.compose.ui.Alignment
2121
import androidx.compose.ui.Modifier
22+
import androidx.compose.ui.draw.clip
2223
import androidx.compose.ui.graphics.Color
2324
import androidx.compose.ui.graphics.vector.ImageVector
2425
import androidx.compose.ui.res.stringResource
2526
import androidx.compose.ui.res.vectorResource
26-
import androidx.compose.ui.text.font.FontWeight
2727
import androidx.compose.ui.unit.dp
28+
import com.adamglin.composeshadow.dropShadow
2829
import com.ninecraft.booket.core.designsystem.ComponentPreview
29-
import com.ninecraft.booket.core.designsystem.theme.Black
3030
import com.ninecraft.booket.core.designsystem.theme.ReedTheme
3131
import com.ninecraft.booket.core.designsystem.theme.White
3232
import com.slack.circuit.backstack.SaveableBackStack
@@ -43,27 +43,42 @@ internal fun MainBottomBar(
4343
onTabSelected: (MainTab) -> Unit,
4444
modifier: Modifier = Modifier,
4545
) {
46-
Box(modifier = modifier.background(White)) {
47-
Column {
48-
HorizontalDivider(color = Black)
49-
Row(
50-
modifier = Modifier
51-
.navigationBarsPadding()
52-
.fillMaxWidth()
53-
.height(64.dp),
54-
verticalAlignment = Alignment.CenterVertically,
55-
) {
56-
tabs.forEach { tab ->
57-
MainBottomBarItem(
58-
tab = tab,
59-
selected = tab == currentTab,
60-
onClick = {
61-
if (tab != currentTab) {
62-
onTabSelected(tab)
63-
}
64-
},
65-
)
66-
}
46+
Box(
47+
modifier = modifier
48+
.dropShadow(
49+
shape = RoundedCornerShape(
50+
topStart = ReedTheme.spacing.spacing3,
51+
topEnd = ReedTheme.spacing.spacing3,
52+
),
53+
color = ReedTheme.colors.borderPrimary,
54+
offsetY = (-4).dp,
55+
blur = 20.dp,
56+
)
57+
.clip(
58+
RoundedCornerShape(
59+
topStart = ReedTheme.spacing.spacing3,
60+
topEnd = ReedTheme.spacing.spacing3,
61+
),
62+
)
63+
.background(White),
64+
) {
65+
Row(
66+
modifier = Modifier
67+
.navigationBarsPadding()
68+
.fillMaxWidth()
69+
.height(58.dp),
70+
verticalAlignment = Alignment.CenterVertically,
71+
) {
72+
tabs.forEach { tab ->
73+
MainBottomBarItem(
74+
tab = tab,
75+
selected = tab == currentTab,
76+
onClick = {
77+
if (tab != currentTab) {
78+
onTabSelected(tab)
79+
}
80+
},
81+
)
6782
}
6883
}
6984
}
@@ -91,17 +106,18 @@ private fun RowScope.MainBottomBarItem(
91106
Column(
92107
horizontalAlignment = Alignment.CenterHorizontally,
93108
) {
109+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing2))
94110
Icon(
95111
imageVector = if (selected) ImageVector.vectorResource(tab.selectedIconResId)
96112
else ImageVector.vectorResource(tab.iconResId),
97113
contentDescription = tab.contentDescription,
98114
tint = Color.Unspecified,
99115
)
100-
Spacer(modifier = Modifier.height(5.dp))
116+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing1))
101117
Text(
102118
text = stringResource(tab.labelResId),
103-
color = if (selected) Color(0xFF1F1F1F) else Color(0xFF9E9E9E),
104-
fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Normal,
119+
color = if (selected) ReedTheme.colors.contentPrimary else ReedTheme.colors.contentSecondary,
120+
style = ReedTheme.typography.caption2Regular,
105121
)
106122
}
107123
}

feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/component/MainTab.kt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import androidx.annotation.StringRes
55
import com.ninecraft.booket.feature.main.R
66
import com.ninecraft.booket.screens.HomeScreen
77
import com.ninecraft.booket.screens.LibraryScreen
8-
import com.ninecraft.booket.screens.SearchScreen
98
import com.slack.circuit.runtime.screen.Screen
109

1110
enum class MainTab(
@@ -16,22 +15,15 @@ enum class MainTab(
1615
val screen: Screen,
1716
) {
1817
HOME(
19-
iconResId = R.drawable.ic_home_tab,
20-
selectedIconResId = R.drawable.ic_selected_home_tab,
18+
iconResId = R.drawable.ic_home,
19+
selectedIconResId = R.drawable.ic_selected_home,
2120
labelResId = R.string.home_label,
2221
contentDescription = "Home Icon",
2322
screen = HomeScreen,
2423
),
25-
SEARCH(
26-
iconResId = R.drawable.ic_search_tab,
27-
selectedIconResId = R.drawable.ic_selected_search_tab,
28-
labelResId = R.string.search_label,
29-
contentDescription = "Search Icon",
30-
screen = SearchScreen,
31-
),
3224
LIBRARY(
33-
iconResId = R.drawable.ic_library_tab,
34-
selectedIconResId = R.drawable.ic_selected_library_tab,
25+
iconResId = R.drawable.ic_library,
26+
selectedIconResId = R.drawable.ic_selected_library,
3527
labelResId = R.string.library_label,
3628
contentDescription = "Library Icon",
3729
screen = LibraryScreen,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="25dp"
3+
android:height="24dp"
4+
android:viewportWidth="25"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M3.757,15.165C3.757,13.821 3.75,12.476 3.757,11.132C3.766,9.64 4.353,8.387 5.543,7.513C7.464,6.109 9.43,4.771 11.399,3.439C12.305,2.827 13.267,2.868 14.163,3.48C16.085,4.79 18.007,6.099 19.884,7.469C21.128,8.374 21.73,9.671 21.737,11.217C21.749,13.906 21.771,16.594 21.737,19.283C21.712,21.123 20.907,21.905 19.083,21.981C18.31,22.012 17.534,21.993 16.757,21.997C15.744,22.003 15.233,21.511 15.214,20.488C15.205,20.028 15.189,19.551 15.075,19.109C14.769,17.935 13.857,17.263 12.699,17.282C11.611,17.301 10.762,17.955 10.415,19.04C10.367,19.188 10.326,19.337 10.301,19.488C10.024,21.177 9.006,22.014 7.25,22C6.836,21.997 6.42,22 6.01,21.962C4.631,21.829 3.839,21.069 3.779,19.662C3.712,18.166 3.763,16.664 3.763,15.165C3.763,15.165 3.76,15.165 3.757,15.165Z"
8+
android:fillColor="#E5E5E5"/>
9+
</vector>

feature/main/src/main/res/drawable/ic_home_tab.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="25dp"
3+
android:height="24dp"
4+
android:viewportWidth="25"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M2.25,6.143V16.857C2.25,18.041 3.245,19 4.472,19H20.028C21.255,19 22.25,18.041 22.25,16.857V8.286C22.25,7.102 21.255,6.143 20.028,6.143H13.361L11.139,4H4.472C3.245,4 2.25,4.959 2.25,6.143Z"
8+
android:fillColor="#E5E5E5"/>
9+
</vector>

feature/main/src/main/res/drawable/ic_library_tab.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

feature/main/src/main/res/drawable/ic_search_tab.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="25dp"
3+
android:height="24dp"
4+
android:viewportWidth="25"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M3.757,15.165C3.757,13.821 3.75,12.476 3.757,11.132C3.766,9.64 4.353,8.387 5.543,7.513C7.464,6.109 9.43,4.771 11.399,3.439C12.305,2.827 13.267,2.868 14.163,3.48C16.085,4.79 18.007,6.099 19.884,7.469C21.128,8.374 21.73,9.671 21.737,11.217C21.749,13.906 21.771,16.594 21.737,19.283C21.712,21.123 20.907,21.905 19.083,21.981C18.31,22.012 17.534,21.993 16.757,21.997C15.744,22.003 15.233,21.511 15.214,20.488C15.205,20.028 15.189,19.551 15.075,19.109C14.769,17.935 13.857,17.263 12.699,17.282C11.611,17.301 10.762,17.955 10.415,19.04C10.367,19.188 10.326,19.337 10.301,19.488C10.024,21.177 9.006,22.014 7.25,22C6.836,21.997 6.42,22 6.01,21.962C4.631,21.829 3.839,21.069 3.779,19.662C3.712,18.166 3.763,16.664 3.763,15.165C3.763,15.165 3.76,15.165 3.757,15.165Z"
8+
android:fillColor="#262626"/>
9+
</vector>

feature/main/src/main/res/drawable/ic_selected_home_tab.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="25dp"
3+
android:height="24dp"
4+
android:viewportWidth="25"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M2.25,6.143V16.857C2.25,18.041 3.245,19 4.472,19H20.028C21.255,19 22.25,18.041 22.25,16.857V8.286C22.25,7.102 21.255,6.143 20.028,6.143H13.361L11.139,4H4.472C3.245,4 2.25,4.959 2.25,6.143Z"
8+
android:fillColor="#262626"/>
9+
</vector>

0 commit comments

Comments
 (0)