File tree Expand file tree Collapse file tree 9 files changed +64
-7
lines changed
build-logic/convention/src/main/kotlin
src/main/java/com/plottwist/core/ui/navigation
home/src/main/java/com/plottwist/feature/home
src/main/java/com/plottwist/feature/main Expand file tree Collapse file tree 9 files changed +64
-7
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class FeatureConventionPlugin: Plugin<Project> {
2626 dependencies {
2727 add(" implementation" , project(" :core:domain" ))
2828 add(" implementation" , project(" :core:ui" ))
29+ add(" implementation" , project(" :core:ui-navigation" ))
2930 add(" implementation" , project(" :core:designsystem" ))
3031
3132 add(" implementation" , libs.findLibrary(" core.ktx" ).get())
Original file line number Diff line number Diff line change 11plugins {
22 alias(libs.plugins.tuk.android.library)
3+ alias(libs.plugins.kotlinx.serialization.plugin)
34}
45
56android {
67 namespace = " com.plottwist.core.ui.navigation"
78}
89
910dependencies {
10- implementation(libs.core.ktx)
11- implementation(libs.appcompat)
12- implementation(libs.material)
11+ implementation(libs.kotlinx.serialization)
1312 testImplementation(libs.junit)
1413 androidTestImplementation(libs.androidx.test.ext.junit)
1514 androidTestImplementation(libs.espresso.core)
Original file line number Diff line number Diff line change 1+ package com.plottwist.core.ui.navigation
2+
3+ import kotlinx.serialization.Serializable
4+
5+
6+ sealed interface Route {
7+
8+ @Serializable
9+ data object Home : Route
10+ }
Original file line number Diff line number Diff line change 1+ package com.plottwist.feature.home
2+
3+ import androidx.compose.material3.Text
4+ import androidx.compose.runtime.Composable
5+ import androidx.compose.ui.Modifier
6+
7+ @Composable
8+ fun HomeScreen (
9+ modifier : Modifier = Modifier
10+ ) {
11+ Text (text = " 홈" )
12+ }
Original file line number Diff line number Diff line change 1+ package com.plottwist.feature.home.navigation
2+
3+ import androidx.navigation.NavGraphBuilder
4+ import androidx.navigation.compose.composable
5+ import com.plottwist.core.ui.navigation.Route
6+ import com.plottwist.feature.home.HomeScreen
7+
8+ fun NavGraphBuilder.homeNavGraph () {
9+ composable<Route .Home > {
10+ HomeScreen ()
11+ }
12+ }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ android {
88}
99
1010dependencies {
11+ implementation(project(" :feature:home" ))
1112 testImplementation(libs.junit)
1213 androidTestImplementation(libs.androidx.test.ext.junit)
1314 androidTestImplementation(libs.espresso.core)
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ package com.plottwist.feature.main
33import androidx.compose.foundation.layout.fillMaxSize
44import androidx.compose.foundation.layout.padding
55import androidx.compose.material3.Scaffold
6- import androidx.compose.material3.Text
76import androidx.compose.runtime.Composable
87import androidx.compose.ui.Modifier
8+ import com.plottwist.feature.main.ui.component.TukNavHost
99
1010@Composable
1111fun TukApp (
@@ -14,9 +14,8 @@ fun TukApp(
1414 Scaffold (
1515 modifier = modifier.fillMaxSize()
1616 ) { innerPadding ->
17- Text (
18- modifier = Modifier .padding(innerPadding),
19- text = " Tuk"
17+ TukNavHost (
18+ modifier = Modifier .padding(innerPadding)
2019 )
2120 }
2221}
Original file line number Diff line number Diff line change 1+ package com.plottwist.feature.main.ui.component
2+
3+ import androidx.compose.runtime.Composable
4+ import androidx.compose.ui.Modifier
5+ import androidx.navigation.NavHostController
6+ import androidx.navigation.compose.NavHost
7+ import androidx.navigation.compose.rememberNavController
8+ import com.plottwist.core.ui.navigation.Route
9+ import com.plottwist.feature.home.navigation.homeNavGraph
10+
11+ @Composable
12+ fun TukNavHost (
13+ modifier : Modifier = Modifier ,
14+ navController : NavHostController = rememberNavController()
15+ ) {
16+ NavHost (
17+ modifier = modifier,
18+ navController = navController,
19+ startDestination = Route .Home
20+ ) {
21+ homeNavGraph()
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments