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..19c0bc4f9 --- /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..f15672b2e 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -9,9 +9,11 @@ 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 @@ -20,7 +22,7 @@ class MainNavigator( @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.MyPage -> 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..9eea00c5b 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -16,8 +16,10 @@ 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.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 @Composable fun MainScreen( @@ -42,8 +44,10 @@ fun MainScreen( navController = navigator.navController, startDestination = navigator.startDestination ) { - firstNavGraph() - mockNavGraph() + homeNavGraph() + calendarNavGraph() + searchNavGraph() + myPageNavGraph() } } } 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..10ddc8cd2 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,31 @@ 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 - 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_false, + contentDescription = R.string.bottom_nav_home, + route = com.terning.feature.home.navigation.Home + ), + Calendar( + icon = R.drawable.ic_nav_calendar_false, + contentDescription = R.string.bottom_nav_calendar, + route = com.terning.feature.calendar.navigation.Calendar + ), + Search( + icon = R.drawable.ic_nav_search_false, + contentDescription = R.string.bottom_nav_search, + route = com.terning.feature.search.navigation.Search ), - MOCK( - icon = R.drawable.ic_home, - contentDescription = R.string.mock, - route = Mock + MyPage( + icon = R.drawable.ic_nav_my_page_true, + contentDescription = R.string.bottom_nav_my_page, + route = com.terning.feature.myPage.navigation.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..5eb1cfd88 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..daa347efe 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..557cf2a99 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 95% 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..8d775830d 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 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..08b66472e 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..5bf303136 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..e11003094 --- /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.calendar.CalendarRoute +import kotlinx.serialization.Serializable + +fun NavController.navigateSearch(navOptions: NavOptions? = null) { + navigate( + route = Search, + navOptions = navOptions + ) +} + +fun NavGraphBuilder.searchNavGraph() { + composable { + CalendarRoute() + } +} + +@Serializable +data object Search : MainTabRoute \ No newline at end of file diff --git a/feature/src/main/res/drawable/ic_nav_profile_false.xml b/feature/src/main/res/drawable/ic_nav_my_page_false.xml similarity index 100% rename from feature/src/main/res/drawable/ic_nav_profile_false.xml rename to feature/src/main/res/drawable/ic_nav_my_page_false.xml diff --git a/feature/src/main/res/drawable/ic_nav_profile_true.xml b/feature/src/main/res/drawable/ic_nav_my_page_true.xml similarity index 100% rename from feature/src/main/res/drawable/ic_nav_profile_true.xml rename to feature/src/main/res/drawable/ic_nav_my_page_true.xml diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index 51ab71090..564560740 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