Closed joakimtall closed 1 year ago
Hmm I guess the bars are green but shaded like everything else? I didnt notice this with my attempt at full screen dialog
I seem to be having the same problem, I am needing to create a full-screen dialog that also updates the action bar colour in compose to white to match the background of the dialog. Did you manage to figure out a workaround for this?
No, the only workaround I have is to build a new navigation component with a custom full screen dialog system that does not use the compose dialog at all. A very heavy workaround.
We seem to have the exact same usecase
On Mon, 20 Mar 2023 at 13:28, Josh Owen @.***> wrote:
I seem to be having the same problem, I am needing to create a full-screen dialog that also updates the action bar colour in compose to white to match the background of the dialog. Did you manage to figure out a workaround for this?
— Reply to this email directly, view it on GitHub https://github.com/google/accompanist/issues/1535#issuecomment-1476138757, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4HVPG2VCMSEUNVSQDATM73W5BEQPANCNFSM6AAAAAAVQCZ6OY . You are receiving this because you authored the thread.Message ID: @.***>
The sample project has an example of usage in a Compose Dialog
:
That might be useful as a guide?
Wow, that actually works!
Things like this might be the secret 😮
// Update the light and dark status bar state for both the Activity's SystemUiController and
// the Dialog's. If we just updated the Dialog's things wouldn't work properly for unknown
// reasons.
LaunchedEffect(parentSystemUiController, statusBarDarkIcons, navigationBarDarkIcons) {
systemUiController.statusBarDarkContentEnabled = statusBarDarkIcons
systemUiController.navigationBarDarkContentEnabled = navigationBarDarkIcons
parentSystemUiController.statusBarDarkContentEnabled = statusBarDarkIcons
parentSystemUiController.navigationBarDarkContentEnabled = navigationBarDarkIcons
}
Thanks!
Maybe this should be more obvious or better documented but that would be another issue
Code like the following works well outside of a dialog, but when showing a dialog it does nothing, even if run inside the dialog composable (to get the correct window ref)
Steps to reproduce
Just show a compose
Dialog
and use system ui controller to change system bar colorsHere is a complete repro project: https://github.com/joakimtall/repro-dialog-bugs/tree/set-systembar-colors-does-nothing-in-compose-dialog
Repro project not showing dialog (bar color change works)
Repro project showing dialog (bar color is reset to some dialog default, even with system ui controller inside dialog)