diff --git a/feature/src/main/java/com/terning/feature/calendar/CalendarRouth.kt b/feature/src/main/java/com/terning/feature/calendar/CalendarRouth.kt new file mode 100644 index 000000000..76ef0be7f --- /dev/null +++ b/feature/src/main/java/com/terning/feature/calendar/CalendarRouth.kt @@ -0,0 +1,19 @@ +package com.terning.feature.calendar + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + +@Composable +fun CalendarRoute() { + CalendarScreen() +} + +@Composable +fun CalendarScreen() { + Column(modifier = Modifier.fillMaxSize()) { + Text(text = "캘린더 스크린") + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/calendar/navigation/CalendarNavigation.kt b/feature/src/main/java/com/terning/feature/calendar/navigation/CalendarNavigation.kt new file mode 100644 index 000000000..542b876d8 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/calendar/navigation/CalendarNavigation.kt @@ -0,0 +1,26 @@ +package com.terning.feature.calendar.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavOptions +import androidx.navigation.compose.composable +import com.terning.core.navigation.MainTabRoute +import com.terning.feature.calendar.CalendarRoute +import kotlinx.serialization.Serializable + + +fun NavController.navigateCalendar(navOptions: NavOptions? = null) { + navigate( + route = Calendar, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.calendarNavGraph() { + composable { + CalendarRoute() + } +} + +@Serializable +data object Calendar : MainTabRoute \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/first/FirstRoute.kt b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt similarity index 69% rename from feature/src/main/java/com/terning/feature/first/FirstRoute.kt rename to feature/src/main/java/com/terning/feature/home/HomeRoute.kt index cb68304e1..aa516b623 100644 --- a/feature/src/main/java/com/terning/feature/first/FirstRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt @@ -1,4 +1,4 @@ -package com.terning.feature.first +package com.terning.feature.home import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize @@ -7,13 +7,13 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @Composable -fun FirstRoute() { - FirstScreen() +fun HomeRoute() { + HomeScreen() } @Composable -fun FirstScreen() { +fun HomeScreen() { Column(modifier = Modifier.fillMaxSize()) { - Text(text = "This is FirstScreen") + Text(text = "홈 스크린") } } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/mock/navigation/MockNavigation.kt b/feature/src/main/java/com/terning/feature/home/navigation/HometNavigation.kt similarity index 54% rename from feature/src/main/java/com/terning/feature/mock/navigation/MockNavigation.kt rename to feature/src/main/java/com/terning/feature/home/navigation/HometNavigation.kt index 0aef1ddf3..2afb85aa5 100644 --- a/feature/src/main/java/com/terning/feature/mock/navigation/MockNavigation.kt +++ b/feature/src/main/java/com/terning/feature/home/navigation/HometNavigation.kt @@ -1,25 +1,25 @@ -package com.terning.feature.mock.navigation +package com.terning.feature.home.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.MainTabRoute -import com.terning.feature.mock.MockRoute +import com.terning.feature.home.HomeRoute import kotlinx.serialization.Serializable -fun NavController.navigateMock(navOptions: NavOptions? = null) { +fun NavController.navigateHome(navOptions: NavOptions? = null) { navigate( - route = Mock, + route = Home, navOptions = navOptions ) } -fun NavGraphBuilder.mockNavGraph() { - composable { - MockRoute() +fun NavGraphBuilder.homeNavGraph() { + composable { + HomeRoute() } } @Serializable -data object Mock : MainTabRoute \ No newline at end of file +data object Home : MainTabRoute \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index 4ca92ceec..a885ac342 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -9,18 +9,20 @@ import androidx.navigation.NavHostController import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import androidx.navigation.navOptions -import com.terning.feature.first.navigation.First -import com.terning.feature.first.navigation.navigateFirst -import com.terning.feature.mock.navigation.navigateMock +import com.terning.feature.calendar.navigation.navigateCalendar +import com.terning.feature.home.navigation.Home +import com.terning.feature.home.navigation.navigateHome +import com.terning.feature.mypage.navigation.navigateMyPage +import com.terning.feature.search.navigation.navigateSearch class MainNavigator( - val navController: NavHostController + val navController: NavHostController, ) { private val currentDestination: NavDestination? @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = First + val startDestination = Home val currentTab: MainTab? @Composable get() = MainTab.find { tab -> @@ -37,19 +39,13 @@ class MainNavigator( } when (tab) { - MainTab.FIRST -> navController.navigateFirst(navOptions) - MainTab.MOCK -> navController.navigateMock(navOptions) + MainTab.HOME -> navController.navigateHome(navOptions) + MainTab.CALENDAR -> navController.navigateCalendar(navOptions) + MainTab.SEARCH -> navController.navigateSearch(navOptions) + MainTab.MY_PAGE -> navController.navigateMyPage(navOptions) } } - fun navigateToFirst() { - navController.navigateFirst() - } - - fun navigateToMock() { - navController.navigateMock() - } - private fun navigateUp() { navController.navigateUp() } diff --git a/feature/src/main/java/com/terning/feature/main/MainScreen.kt b/feature/src/main/java/com/terning/feature/main/MainScreen.kt index 29167b458..257bf2e23 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -1,14 +1,19 @@ package com.terning.feature.main import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.interaction.Interaction +import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.material3.Icon +import androidx.compose.material3.LocalAbsoluteTonalElevation +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.NavigationBar import androidx.compose.material3.NavigationBarItem import androidx.compose.material3.Scaffold import androidx.compose.material3.Text +import androidx.compose.material3.surfaceColorAtElevation import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource @@ -16,8 +21,15 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.navigation.compose.NavHost -import com.terning.feature.first.navigation.firstNavGraph -import com.terning.feature.mock.navigation.mockNavGraph +import com.terning.core.designsystem.theme.Grey300 +import com.terning.core.designsystem.theme.TerningMain +import com.terning.core.designsystem.theme.White +import com.terning.feature.calendar.navigation.calendarNavGraph +import com.terning.feature.home.navigation.homeNavGraph +import com.terning.feature.mypage.navigation.myPageNavGraph +import com.terning.feature.search.navigation.searchNavGraph +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.emptyFlow @Composable fun MainScreen( @@ -42,8 +54,10 @@ fun MainScreen( navController = navigator.navController, startDestination = navigator.startDestination ) { - firstNavGraph() - mockNavGraph() + homeNavGraph() + calendarNavGraph() + searchNavGraph() + myPageNavGraph() } } } @@ -59,9 +73,10 @@ private fun MainBottomBar( AnimatedVisibility( visible = isVisible, ) { - NavigationBar { + NavigationBar(containerColor = White) { tabs.forEach { itemType -> NavigationBarItem( + interactionSource = NoRippleInteractionSource, selected = currentTab == itemType, onClick = { onTabSelected(itemType) @@ -78,8 +93,27 @@ private fun MainBottomBar( fontSize = 9.sp ) }, + colors = androidx.compose.material3.NavigationBarItemDefaults + .colors( + selectedIconColor = TerningMain, + selectedTextColor = TerningMain, + unselectedIconColor = Grey300, + unselectedTextColor = Grey300, + indicatorColor = White + ) + ) } } } } + + +private object NoRippleInteractionSource : MutableInteractionSource { + + override val interactions: Flow = emptyFlow() + + override suspend fun emit(interaction: Interaction) {} + + override fun tryEmit(interaction: Interaction) = true +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/main/MainTab.kt b/feature/src/main/java/com/terning/feature/main/MainTab.kt index f579742d7..4273117a2 100644 --- a/feature/src/main/java/com/terning/feature/main/MainTab.kt +++ b/feature/src/main/java/com/terning/feature/main/MainTab.kt @@ -6,24 +6,35 @@ import androidx.compose.runtime.Composable import com.terning.core.navigation.MainTabRoute import com.terning.core.navigation.Route import com.terning.feature.R -import com.terning.feature.first.navigation.First -import com.terning.feature.mock.navigation.Mock - +import com.terning.feature.calendar.navigation.Calendar +import com.terning.feature.home.navigation.Home +import com.terning.feature.mypage.navigation.MyPage +import com.terning.feature.search.navigation.Search enum class MainTab( @DrawableRes val icon: Int, @StringRes val contentDescription: Int, val route: MainTabRoute, ) { - FIRST( - icon = R.drawable.ic_home, - contentDescription = R.string.first, - route = First + HOME( + icon = R.drawable.ic_nav_home, + contentDescription = R.string.bottom_nav_home, + route = Home + ), + CALENDAR( + icon = R.drawable.ic_nav_calendar, + contentDescription = R.string.bottom_nav_calendar, + route = Calendar + ), + SEARCH( + icon = R.drawable.ic_nav_search, + contentDescription = R.string.bottom_nav_search, + route = Search ), - MOCK( - icon = R.drawable.ic_home, - contentDescription = R.string.mock, - route = Mock + MY_PAGE( + icon = R.drawable.ic_nav_my_page, + contentDescription = R.string.bottom_nav_my_page, + route = MyPage ); companion object { diff --git a/feature/src/main/java/com/terning/feature/mock/MockItem.kt b/feature/src/main/java/com/terning/feature/mypage/MockItem.kt similarity index 97% rename from feature/src/main/java/com/terning/feature/mock/MockItem.kt rename to feature/src/main/java/com/terning/feature/mypage/MockItem.kt index 2cd3c9135..68189056b 100644 --- a/feature/src/main/java/com/terning/feature/mock/MockItem.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MockItem.kt @@ -1,4 +1,4 @@ -package com.terning.feature.mock +package com.terning.feature.mypage import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Row diff --git a/feature/src/main/java/com/terning/feature/mock/MockSideEffect.kt b/feature/src/main/java/com/terning/feature/mypage/MockSideEffect.kt similarity index 79% rename from feature/src/main/java/com/terning/feature/mock/MockSideEffect.kt rename to feature/src/main/java/com/terning/feature/mypage/MockSideEffect.kt index faf43e51f..c205854f0 100644 --- a/feature/src/main/java/com/terning/feature/mock/MockSideEffect.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MockSideEffect.kt @@ -1,4 +1,4 @@ -package com.terning.feature.mock +package com.terning.feature.mypage import androidx.annotation.StringRes diff --git a/feature/src/main/java/com/terning/feature/mock/MockState.kt b/feature/src/main/java/com/terning/feature/mypage/MockState.kt similarity index 84% rename from feature/src/main/java/com/terning/feature/mock/MockState.kt rename to feature/src/main/java/com/terning/feature/mypage/MockState.kt index 92e560987..d43e66aa2 100644 --- a/feature/src/main/java/com/terning/feature/mock/MockState.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MockState.kt @@ -1,4 +1,4 @@ -package com.terning.feature.mock +package com.terning.feature.mypage import com.terning.core.state.UiState import com.terning.domain.entity.response.MockResponseModel diff --git a/feature/src/main/java/com/terning/feature/mock/MockRoute.kt b/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt similarity index 93% rename from feature/src/main/java/com/terning/feature/mock/MockRoute.kt rename to feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt index a9a958ddf..f72da0835 100644 --- a/feature/src/main/java/com/terning/feature/mock/MockRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt @@ -1,4 +1,4 @@ -package com.terning.feature.mock +package com.terning.feature.mypage import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding @@ -19,8 +19,8 @@ import com.terning.core.state.UiState import com.terning.domain.entity.response.MockResponseModel @Composable -fun MockRoute( - viewModel: MockViewModel = hiltViewModel() +fun MyPageRoute( + viewModel: MyPageViewModel = hiltViewModel(), ) { val context = LocalContext.current @@ -53,7 +53,7 @@ fun MockRoute( @Composable fun MockScreen( - mockList: List + mockList: List, ) { LazyColumn( modifier = Modifier diff --git a/feature/src/main/java/com/terning/feature/mock/MockViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt similarity index 92% rename from feature/src/main/java/com/terning/feature/mock/MockViewModel.kt rename to feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt index fc95339bb..79a3a9eff 100644 --- a/feature/src/main/java/com/terning/feature/mock/MockViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt @@ -1,4 +1,4 @@ -package com.terning.feature.mock +package com.terning.feature.mypage import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope @@ -16,7 +16,7 @@ import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel -class MockViewModel @Inject constructor(private val repository: MockRepository) : ViewModel() { +class MyPageViewModel @Inject constructor(private val repository: MockRepository) : ViewModel() { private val _state: MutableStateFlow = MutableStateFlow(MockState()) diff --git a/feature/src/main/java/com/terning/feature/first/navigation/FirstNavigation.kt b/feature/src/main/java/com/terning/feature/mypage/navigation/MyPageNavigation.kt similarity index 52% rename from feature/src/main/java/com/terning/feature/first/navigation/FirstNavigation.kt rename to feature/src/main/java/com/terning/feature/mypage/navigation/MyPageNavigation.kt index 3ef921901..f7b36900d 100644 --- a/feature/src/main/java/com/terning/feature/first/navigation/FirstNavigation.kt +++ b/feature/src/main/java/com/terning/feature/mypage/navigation/MyPageNavigation.kt @@ -1,25 +1,25 @@ -package com.terning.feature.first.navigation +package com.terning.feature.mypage.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.MainTabRoute -import com.terning.feature.first.FirstRoute +import com.terning.feature.mypage.MyPageRoute import kotlinx.serialization.Serializable -fun NavController.navigateFirst(navOptions: NavOptions? = null) { +fun NavController.navigateMyPage(navOptions: NavOptions? = null) { navigate( - route = First, + route = MyPage, navOptions = navOptions ) } -fun NavGraphBuilder.firstNavGraph() { - composable { - FirstRoute() +fun NavGraphBuilder.myPageNavGraph() { + composable { + MyPageRoute() } } @Serializable -data object First : MainTabRoute \ No newline at end of file +data object MyPage : MainTabRoute \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/SearchRouth.kt b/feature/src/main/java/com/terning/feature/search/SearchRouth.kt new file mode 100644 index 000000000..18c655555 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/SearchRouth.kt @@ -0,0 +1,19 @@ +package com.terning.feature.search + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + +@Composable +fun SearchRoute() { + SearchScreen() +} + +@Composable +fun SearchScreen() { + Column(modifier = Modifier.fillMaxSize()) { + Text(text = "탐색 스크린") + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/search/navigation/SearchNavigation.kt b/feature/src/main/java/com/terning/feature/search/navigation/SearchNavigation.kt new file mode 100644 index 000000000..26e2036b6 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/search/navigation/SearchNavigation.kt @@ -0,0 +1,25 @@ +package com.terning.feature.search.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavOptions +import androidx.navigation.compose.composable +import com.terning.core.navigation.MainTabRoute +import com.terning.feature.search.SearchRoute +import kotlinx.serialization.Serializable + +fun NavController.navigateSearch(navOptions: NavOptions? = null) { + navigate( + route = Search, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.searchNavGraph() { + composable { + SearchRoute() + } +} + +@Serializable +data object Search : MainTabRoute \ No newline at end of file diff --git a/feature/src/main/res/drawable/ic_nav_calendar.xml b/feature/src/main/res/drawable/ic_nav_calendar.xml new file mode 100644 index 000000000..18d8a7c30 --- /dev/null +++ b/feature/src/main/res/drawable/ic_nav_calendar.xml @@ -0,0 +1,9 @@ + + + diff --git a/feature/src/main/res/drawable/ic_home.xml b/feature/src/main/res/drawable/ic_nav_home.xml similarity index 100% rename from feature/src/main/res/drawable/ic_home.xml rename to feature/src/main/res/drawable/ic_nav_home.xml diff --git a/feature/src/main/res/drawable/ic_nav_my_page.xml b/feature/src/main/res/drawable/ic_nav_my_page.xml new file mode 100644 index 000000000..9265715c0 --- /dev/null +++ b/feature/src/main/res/drawable/ic_nav_my_page.xml @@ -0,0 +1,9 @@ + + + diff --git a/feature/src/main/res/drawable/ic_nav_search.xml b/feature/src/main/res/drawable/ic_nav_search.xml new file mode 100644 index 000000000..ce3fd2fbd --- /dev/null +++ b/feature/src/main/res/drawable/ic_nav_search.xml @@ -0,0 +1,20 @@ + + + + diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 51ab71090..133c0442b 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -5,7 +5,9 @@ 서버통신 성공 서버통신 실패 - first - mock + + 캘린더 + 탐색 + 마이페이지 \ No newline at end of file