|
|
@ -18,6 +18,7 @@ package com.google.samples.apps.nowinandroid.feature.interests.navigation
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.navigation.NavGraphBuilder
|
|
|
|
import androidx.navigation.NavGraphBuilder
|
|
|
|
import androidx.navigation.compose.composable
|
|
|
|
import androidx.navigation.compose.composable
|
|
|
|
|
|
|
|
import androidx.navigation.navigation
|
|
|
|
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigationDestination
|
|
|
|
import com.google.samples.apps.nowinandroid.core.navigation.NiaNavigationDestination
|
|
|
|
import com.google.samples.apps.nowinandroid.feature.interests.InterestsRoute
|
|
|
|
import com.google.samples.apps.nowinandroid.feature.interests.InterestsRoute
|
|
|
|
|
|
|
|
|
|
|
@ -28,12 +29,20 @@ object InterestsDestination : NiaNavigationDestination {
|
|
|
|
|
|
|
|
|
|
|
|
fun NavGraphBuilder.interestsGraph(
|
|
|
|
fun NavGraphBuilder.interestsGraph(
|
|
|
|
navigateToTopic: (String) -> Unit,
|
|
|
|
navigateToTopic: (String) -> Unit,
|
|
|
|
navigateToAuthor: (String) -> Unit
|
|
|
|
navigateToAuthor: (String) -> Unit,
|
|
|
|
|
|
|
|
nestedGraphs: NavGraphBuilder.() -> Unit
|
|
|
|
|
|
|
|
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
composable(route = InterestsDestination.route) {
|
|
|
|
navigation(
|
|
|
|
|
|
|
|
route = InterestsDestination.route,
|
|
|
|
|
|
|
|
startDestination = InterestsDestination.destination
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
composable(route = InterestsDestination.destination) {
|
|
|
|
InterestsRoute(
|
|
|
|
InterestsRoute(
|
|
|
|
navigateToTopic = navigateToTopic,
|
|
|
|
navigateToTopic = navigateToTopic,
|
|
|
|
navigateToAuthor = navigateToAuthor,
|
|
|
|
navigateToAuthor = navigateToAuthor,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nestedGraphs()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|