Theming in Odyssey
MegaAndroidDeveloper666 opened this issue · comments
It is not available to pass own app theme by setupNavigation()
function.
Way to achieve that: get code from setupNavigation and wrap ModalNavigator with own theme:
val navigationGraph: RootComposeBuilder.() -> Unit = {
screen("screen1") {
Screen1()
}
screen(name = "screen2") {
Screen2()
}
}
val rootController = RootComposeBuilder().apply(navigationGraph).build()
rootController.setupWithActivity(this)
setContent {
CompositionLocalProvider(
LocalRootController provides rootController
) {
AppTheme() {
ModalNavigator {
Navigator("main")
}
}
}
}
Would be awesome to have a tool to pass own app theme
Hello, thank you for issue
Here you can see example - https://github.com/AlexGladkov/Odyssey/blob/main/android/src/main/java/ru/alexgladkov/odyssey_demo/theme/Activity%20%2B%20Setup.kt
I can add it to readme