Skip to content
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

Theming in Odyssey #39

Closed
MegaAndroidDeveloper666 opened this issue Apr 28, 2022 · 1 comment
Closed

Theming in Odyssey #39

MegaAndroidDeveloper666 opened this issue Apr 28, 2022 · 1 comment

Comments

@MegaAndroidDeveloper666

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

@AlexGladkov
Copy link
Owner

AlexGladkov commented Apr 29, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants