Last active
October 27, 2022 04:23
-
-
Save Morfly/c416052007bc08db754e4131fb4e8b90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.navigation.compose.NamedNavArgument | |
interface FeatureEntry { | |
val featureRoute: String | |
val arguments: List<NamedNavArgument> | |
get() = emptyList() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.navigation.NavHostController | |
import androidx.navigation.NavBackStackEntry | |
interface ComposableFeatureEntry : FeatureEntry { | |
fun NavGraphBuilder.composable( | |
navController: NavHostController, | |
destinations: Destinations, | |
) { backStackEntry -> | |
composable(featureRoute, args) { | |
Composable(navController, destinations, backStackEntry) | |
} | |
} | |
@Composable | |
fun Composable( | |
navController: NavHostController, | |
destinations: Destinations, | |
backStackEntry: NavBackStackEntry | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.navigation.NavHostController | |
interface AggregateFeatureEntry : FeatureEntry { | |
fun NavGraphBuilder.navigation( | |
navController: NavHostController, | |
destinations: Destinations, | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment