AlexGladkov / Odyssey

Odyssey it's a declarative multiplatform navigation library for Multiplatform Compose
https://youtube.com/c/MobileDeveloper
MIT License
255 stars 20 forks source link

Screen transition dynamic color change bug #93

Open maltsev-gorskij opened 1 year ago

maltsev-gorskij commented 1 year ago

In one of my applications, there was a need to implement a dynamic theme change. But i stumbled upon a problem during attempts to change screens transition background color programmatically together with changing application theme.

In the Odyssey library, the background color when animating the transition between screens is set by a separate parameter backgroundColor in the OdysseyConfiguration class, which is passed to setNavigationContent when constructing the navigation graph. Example was found here

In this minimal example i tried to simulate the dynamic transition background color change.

Initially, there is no problem, but after the first transition background color change, the screen is becoming colored with the solid color of the current backgroundColor value. The content on the screen disappears.

Way to reproduce: Click on Set Dark Transition Background button on first screen in this example project. image image

Please help me figure out how to dynamically change the color of screens transition in runtime.

SudoDios commented 1 year ago

Change your screens on content background color (Do not change the background color on config)