-
Notifications
You must be signed in to change notification settings - Fork 1
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
[ADD/#8] 바텀 네비게이션 추가 #10
Changes from 6 commits
6e7ce11
993df86
f3878af
1a4cb7a
6c31f2b
954ab25
2d99302
c6696c0
5bf385a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = "캘린더 스크린") | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Calendar> { | ||
CalendarRoute() | ||
} | ||
} | ||
|
||
@Serializable | ||
data object Calendar : MainTabRoute |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Mock> { | ||
MockRoute() | ||
fun NavGraphBuilder.homeNavGraph() { | ||
composable<Home> { | ||
HomeRoute() | ||
} | ||
} | ||
|
||
@Serializable | ||
data object Mock : MainTabRoute | ||
data object Home : MainTabRoute |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.terning.feature.mock | ||
package com.terning.feature.myPage | ||
|
||
import androidx.compose.foundation.Image | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 패키징 관련해서도 컨벤션 맞추는 게 좋을 것 같은데 소문자로 가는 거 어때용,,? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오홍 좋아요!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 바로 변경했읍니다. |
||
import androidx.compose.foundation.layout.Row | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.terning.feature.mock | ||
package com.terning.feature.myPage | ||
|
||
import androidx.annotation.StringRes | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<First> { | ||
FirstRoute() | ||
fun NavGraphBuilder.myPageNavGraph() { | ||
composable<MyPage> { | ||
MyPageRoute() | ||
} | ||
} | ||
|
||
@Serializable | ||
data object First : MainTabRoute | ||
data object MyPage : MainTabRoute |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = "탐색 스크린") | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Search> { | ||
SearchRoute() | ||
} | ||
} | ||
|
||
@Serializable | ||
data object Search : MainTabRoute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 import 할 때
import com.terning.feature.home.navigation.Home
으로 해두면route = Home
으로만 작성해줄 수 있어요!!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
훨씬 깔끔해졌읍니다.