Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mz 149 navigation bar #15

Merged
merged 8 commits into from
Dec 22, 2023
4 changes: 4 additions & 0 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ plugins {
android {
namespace = "com.susu.core.designsystem"
}

dependencies {
implementation(projects.core.ui)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package com.susu.core.designsystem.component.navigation

import androidx.annotation.DrawableRes
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Divider
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.theme.Gray100
import com.susu.core.designsystem.theme.Gray20
import com.susu.core.designsystem.theme.Gray40
import com.susu.core.designsystem.theme.SusuTheme

@Composable
fun SusuNavigationBar(
modifier: Modifier = Modifier,
dividerColor: Color = Gray20,
dividerThickness: Dp = 1.dp,
containerHeight: Dp = 56.dp,
containerColor: Color = SusuTheme.colorScheme.background10,
content: @Composable RowScope.() -> Unit,
) {
Column {
Divider(
thickness = dividerThickness,
color = dividerColor,
)
Row(
modifier = modifier
.height(containerHeight)
.background(color = containerColor),
) {
content()
}
}
}

@Composable
fun RowScope.SusuNavigationItem(
modifier: Modifier = Modifier,
selected: Boolean,
label: String,
@DrawableRes selectedIcon: Int,
@DrawableRes unselectedIcon: Int,
) {
Column(
modifier = modifier
.weight(1f)
.fillMaxHeight(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
val icon = if (selected) selectedIcon else unselectedIcon
Icon(
painter = painterResource(id = icon),
contentDescription = label,
tint = if (selected) Gray100 else Gray40,
)
Text(
text = label,
style = SusuTheme.typography.title_xxxxs,
color = if (selected) Gray100 else Gray40,
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M5,22C4.45,22 3.979,21.804 3.588,21.413C3.197,21.022 3.001,20.551 3,20V15.45L5.75,12.325L7.175,13.75L5.175,16H18.825L16.875,13.8L18.3,12.375L21,15.45V20C21,20.55 20.804,21.021 20.413,21.413C20.022,21.805 19.551,22.001 19,22H5ZM10.6,14.4L7.125,10.875C6.742,10.492 6.55,10.017 6.55,9.45C6.55,8.883 6.742,8.408 7.125,8.025L12.025,3.125C12.408,2.742 12.883,2.55 13.45,2.55C14.017,2.55 14.492,2.742 14.875,3.125L18.4,6.6C18.783,6.983 18.979,7.454 18.988,8.012C18.997,8.57 18.809,9.041 18.425,9.425L13.425,14.425C13.042,14.808 12.571,14.996 12.013,14.988C11.455,14.98 10.984,14.784 10.6,14.4ZM17,8L13.45,4.5L8.5,9.45L12.05,12.95L17,8Z"
android:fillColor="#242424"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M5,22C4.45,22 3.979,21.804 3.588,21.413C3.197,21.022 3.001,20.551 3,20V15.45L5.75,12.325L7.175,13.75L5.175,16H18.825L16.875,13.8L18.3,12.375L21,15.45V20C21,20.55 20.804,21.021 20.413,21.413C20.022,21.805 19.551,22.001 19,22H5ZM5,20H19V18H5V20ZM10.625,14.375L7.1,10.85C6.717,10.467 6.529,9.996 6.538,9.438C6.547,8.88 6.742,8.409 7.125,8.025L12.025,3.125C12.408,2.742 12.883,2.542 13.45,2.525C14.017,2.508 14.492,2.692 14.875,3.075L18.4,6.6C18.783,6.983 18.983,7.45 19,8C19.017,8.55 18.833,9.017 18.45,9.4L13.45,14.4C13.067,14.783 12.596,14.971 12.038,14.963C11.48,14.955 11.009,14.759 10.625,14.375ZM17,8.025L13.475,4.5L8.525,9.45L12.05,12.975L17,8.025Z"
android:fillColor="#D0D0D0"/>
</vector>
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_my_page_filled.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M6,22C5.167,22 4.458,21.708 3.875,21.125C3.292,20.542 3,19.833 3,19V18C3,17.45 3.196,16.979 3.588,16.588C3.98,16.197 4.451,16.001 5,16H6V4C6,3.45 6.196,2.979 6.588,2.588C6.98,2.197 7.451,2.001 8,2H19C19.55,2 20.021,2.196 20.413,2.588C20.805,2.98 21.001,3.451 21,4V19C21,19.833 20.708,20.542 20.125,21.125C19.542,21.708 18.833,22 18,22H6ZM18,20C18.283,20 18.521,19.904 18.713,19.712C18.905,19.52 19.001,19.283 19,19V4H8V16H15C15.55,16 16.021,16.196 16.413,16.588C16.805,16.98 17.001,17.451 17,18V19C17,19.283 17.096,19.521 17.288,19.713C17.48,19.905 17.717,20.001 18,20ZM10,9C9.717,9 9.479,8.904 9.288,8.712C9.097,8.52 9.001,8.283 9,8C9,7.717 9.096,7.479 9.288,7.288C9.48,7.097 9.717,7.001 10,7H17C17.283,7 17.521,7.096 17.713,7.288C17.905,7.48 18.001,7.717 18,8C18,8.283 17.904,8.521 17.712,8.713C17.52,8.905 17.283,9.001 17,9H10ZM10,12C9.717,12 9.479,11.904 9.288,11.712C9.097,11.52 9.001,11.283 9,11C9,10.717 9.096,10.479 9.288,10.288C9.48,10.097 9.717,10.001 10,10H17C17.283,10 17.521,10.096 17.713,10.288C17.905,10.48 18.001,10.717 18,11C18,11.283 17.904,11.521 17.712,11.713C17.52,11.905 17.283,12.001 17,12H10Z"
android:fillColor="#242424"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M6,22C5.167,22 4.458,21.708 3.875,21.125C3.292,20.542 3,19.833 3,19V18C3,17.45 3.196,16.979 3.588,16.588C3.98,16.197 4.451,16.001 5,16H6V4C6,3.45 6.196,2.979 6.588,2.588C6.98,2.197 7.451,2.001 8,2H19C19.55,2 20.021,2.196 20.413,2.588C20.805,2.98 21.001,3.451 21,4V19C21,19.833 20.708,20.542 20.125,21.125C19.542,21.708 18.833,22 18,22H6ZM18,20C18.283,20 18.521,19.904 18.713,19.712C18.905,19.52 19.001,19.283 19,19V4H8V16H15C15.55,16 16.021,16.196 16.413,16.588C16.805,16.98 17.001,17.451 17,18V19C17,19.283 17.096,19.521 17.288,19.713C17.48,19.905 17.717,20.001 18,20ZM10,9C9.717,9 9.479,8.904 9.288,8.712C9.097,8.52 9.001,8.283 9,8C9,7.717 9.096,7.479 9.288,7.288C9.48,7.097 9.717,7.001 10,7H17C17.283,7 17.521,7.096 17.713,7.288C17.905,7.48 18.001,7.717 18,8C18,8.283 17.904,8.521 17.712,8.713C17.52,8.905 17.283,9.001 17,9H10ZM10,12C9.717,12 9.479,11.904 9.288,11.712C9.097,11.52 9.001,11.283 9,11C9,10.717 9.096,10.479 9.288,10.288C9.48,10.097 9.717,10.001 10,10H17C17.283,10 17.521,10.096 17.713,10.288C17.905,10.48 18.001,10.717 18,11C18,11.283 17.904,11.521 17.712,11.713C17.52,11.905 17.283,12.001 17,12H10ZM6,20H15V18H5V19C5,19.283 5.096,19.521 5.288,19.713C5.48,19.905 5.717,20.001 6,20ZM6,20H5H15H6Z"
android:fillColor="#D0D0D0"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M5,22C4.45,22 3.979,21.804 3.588,21.413C3.197,21.022 3.001,20.551 3,20V8.725C2.7,8.542 2.458,8.304 2.275,8.013C2.092,7.722 2,7.384 2,7V4C2,3.45 2.196,2.979 2.588,2.588C2.98,2.197 3.451,2.001 4,2H20C20.55,2 21.021,2.196 21.413,2.588C21.805,2.98 22.001,3.451 22,4V7C22,7.383 21.908,7.721 21.725,8.013C21.542,8.305 21.3,8.542 21,8.724V20C21,20.55 20.804,21.021 20.413,21.413C20.022,21.805 19.551,22.001 19,22H5ZM4,7H20V4H4V7ZM9,14H15V12H9V14Z"
android:fillColor="#242424"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M5,22C4.45,22 3.979,21.804 3.588,21.413C3.197,21.022 3.001,20.551 3,20V8.725C2.7,8.542 2.458,8.304 2.275,8.013C2.092,7.722 2,7.384 2,7V4C2,3.45 2.196,2.979 2.588,2.588C2.98,2.197 3.451,2.001 4,2H20C20.55,2 21.021,2.196 21.413,2.588C21.805,2.98 22.001,3.451 22,4V7C22,7.383 21.908,7.721 21.725,8.013C21.542,8.305 21.3,8.542 21,8.724V20C21,20.55 20.804,21.021 20.413,21.413C20.022,21.805 19.551,22.001 19,22H5ZM5,9V20H19V9H5ZM4,7H20V4H4V7ZM9,14H15V12H9V14Z"
android:fillColor="#D0D0D0"/>
</vector>
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_sent_filled.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4,20C3.45,20 2.979,19.804 2.588,19.413C2.197,19.022 2.001,18.551 2,18V6C2,5.45 2.196,4.979 2.588,4.588C2.98,4.197 3.451,4.001 4,4H20C20.55,4 21.021,4.196 21.413,4.588C21.805,4.98 22.001,5.451 22,6V18C22,18.55 21.804,19.021 21.413,19.413C21.022,19.805 20.551,20.001 20,20H4ZM12,12.825C12.083,12.825 12.171,12.812 12.263,12.787C12.355,12.762 12.442,12.724 12.525,12.675L19.6,8.25C19.733,8.167 19.833,8.063 19.9,7.938C19.967,7.813 20,7.676 20,7.525C20,7.192 19.858,6.942 19.575,6.775C19.292,6.608 19,6.617 18.7,6.8L12,11L5.3,6.8C5,6.617 4.708,6.613 4.425,6.788C4.142,6.963 4,7.209 4,7.525C4,7.692 4.033,7.838 4.1,7.963C4.167,8.088 4.267,8.184 4.4,8.25L11.475,12.675C11.558,12.725 11.646,12.763 11.738,12.788C11.83,12.813 11.917,12.826 12,12.825Z"
android:fillColor="#242424"/>
</vector>
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_sent_outlined.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4,20C3.45,20 2.979,19.804 2.588,19.413C2.197,19.022 2.001,18.551 2,18V6C2,5.45 2.196,4.979 2.588,4.588C2.98,4.197 3.451,4.001 4,4H20C20.55,4 21.021,4.196 21.413,4.588C21.805,4.98 22.001,5.451 22,6V18C22,18.55 21.804,19.021 21.413,19.413C21.022,19.805 20.551,20.001 20,20H4ZM20,8L12.525,12.675C12.442,12.725 12.354,12.763 12.263,12.788C12.172,12.813 12.084,12.826 12,12.825C11.917,12.825 11.829,12.813 11.738,12.788C11.647,12.763 11.559,12.726 11.475,12.675L4,8V18H20V8ZM12,11L20,6H4L12,11ZM4,8.25V6.775V6.8V6.788V8.25Z"
android:fillColor="#D0D0D0"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7,17H12C12.283,17 12.521,16.904 12.713,16.712C12.905,16.52 13.001,16.283 13,16C13,15.717 12.904,15.479 12.712,15.288C12.52,15.097 12.283,15.001 12,15H7C6.717,15 6.479,15.096 6.288,15.288C6.097,15.48 6.001,15.717 6,16C6,16.283 6.096,16.521 6.288,16.713C6.48,16.905 6.717,17.001 7,17ZM17,7C16.717,7 16.479,7.096 16.288,7.288C16.097,7.48 16.001,7.717 16,8V16C16,16.283 16.096,16.521 16.288,16.713C16.48,16.905 16.717,17.001 17,17C17.283,17 17.521,16.904 17.713,16.712C17.905,16.52 18.001,16.283 18,16V8C18,7.717 17.904,7.479 17.712,7.288C17.52,7.097 17.283,7.001 17,7ZM7,13H12C12.283,13 12.521,12.904 12.713,12.712C12.905,12.52 13.001,12.283 13,12C13,11.717 12.904,11.479 12.712,11.288C12.52,11.097 12.283,11.001 12,11H7C6.717,11 6.479,11.096 6.288,11.288C6.097,11.48 6.001,11.717 6,12C6,12.283 6.096,12.521 6.288,12.713C6.48,12.905 6.717,13.001 7,13ZM7,9H12C12.283,9 12.521,8.904 12.713,8.712C12.905,8.52 13.001,8.283 13,8C13,7.717 12.904,7.479 12.712,7.288C12.52,7.097 12.283,7.001 12,7H7C6.717,7 6.479,7.096 6.288,7.288C6.097,7.48 6.001,7.717 6,8C6,8.283 6.096,8.521 6.288,8.713C6.48,8.905 6.717,9.001 7,9ZM4,21C3.45,21 2.979,20.804 2.588,20.413C2.197,20.022 2.001,19.551 2,19V5C2,4.45 2.196,3.979 2.588,3.588C2.98,3.197 3.451,3.001 4,3H20C20.55,3 21.021,3.196 21.413,3.588C21.805,3.98 22.001,4.451 22,5V19C22,19.55 21.804,20.021 21.413,20.413C21.022,20.805 20.551,21.001 20,21H4Z"
android:fillColor="#242424"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7,17H12C12.283,17 12.521,16.904 12.713,16.712C12.905,16.52 13.001,16.283 13,16C13,15.717 12.904,15.479 12.712,15.288C12.52,15.097 12.283,15.001 12,15H7C6.717,15 6.479,15.096 6.288,15.288C6.097,15.48 6.001,15.717 6,16C6,16.283 6.096,16.521 6.288,16.713C6.48,16.905 6.717,17.001 7,17ZM17,7C16.717,7 16.479,7.096 16.288,7.288C16.097,7.48 16.001,7.717 16,8V16C16,16.283 16.096,16.521 16.288,16.713C16.48,16.905 16.717,17.001 17,17C17.283,17 17.521,16.904 17.713,16.712C17.905,16.52 18.001,16.283 18,16V8C18,7.717 17.904,7.479 17.712,7.288C17.52,7.097 17.283,7.001 17,7ZM7,13H12C12.283,13 12.521,12.904 12.713,12.712C12.905,12.52 13.001,12.283 13,12C13,11.717 12.904,11.479 12.712,11.288C12.52,11.097 12.283,11.001 12,11H7C6.717,11 6.479,11.096 6.288,11.288C6.097,11.48 6.001,11.717 6,12C6,12.283 6.096,12.521 6.288,12.713C6.48,12.905 6.717,13.001 7,13ZM7,9H12C12.283,9 12.521,8.904 12.713,8.712C12.905,8.52 13.001,8.283 13,8C13,7.717 12.904,7.479 12.712,7.288C12.52,7.097 12.283,7.001 12,7H7C6.717,7 6.479,7.096 6.288,7.288C6.097,7.48 6.001,7.717 6,8C6,8.283 6.096,8.521 6.288,8.713C6.48,8.905 6.717,9.001 7,9ZM4,21C3.45,21 2.979,20.804 2.588,20.413C2.197,20.022 2.001,19.551 2,19V5C2,4.45 2.196,3.979 2.588,3.588C2.98,3.197 3.451,3.001 4,3H20C20.55,3 21.021,3.196 21.413,3.588C21.805,3.98 22.001,4.451 22,5V19C22,19.55 21.804,20.021 21.413,20.413C21.022,20.805 20.551,21.001 20,21H4ZM4,19H20V5H4V19Z"
android:fillColor="#D0D0D0"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.susu.feature.navigator

import androidx.annotation.DrawableRes
import com.susu.core.designsystem.R

enum class NavigationItem(
@DrawableRes val selectedIcon: Int,
@DrawableRes val unselectedIcon: Int,
val label: String,
) {
SENT(
selectedIcon = R.drawable.ic_sent_filled,
unselectedIcon = R.drawable.ic_sent_outlined,
label = "๋ณด๋‚ด์š”",
),
RECEIVED(
selectedIcon = R.drawable.ic_received_filled,
unselectedIcon = R.drawable.ic_received_outlined,
label = "๋ฐ›์•„์š”",
),
STATISTICS(
selectedIcon = R.drawable.ic_statistics_filled,
unselectedIcon = R.drawable.ic_statistics_outlined,
label = "ํ†ต๊ณ„",
),
COMMUNITY(
selectedIcon = R.drawable.ic_community_filled,
unselectedIcon = R.drawable.ic_community_outlined,
label = "ํˆฌํ‘œ",
),
MYPAGE(
selectedIcon = R.drawable.ic_my_page_filled,
unselectedIcon = R.drawable.ic_my_page_outlined,
label = "๋งˆ์ดํŽ˜์ด์ง€",
),
}