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

Fix Bottom Nav colors not updating after theme change #493

Merged
merged 3 commits into from Jun 1, 2023

Conversation

igorescodro
Copy link
Owner

@igorescodro igorescodro commented May 31, 2023

When updating the system theme under the Preference screen, the colors in the Bottom Nav would remain the previous one until the app recomposes. It's weird because the theme change triggers the high-level recomposition and updates all subsequent components.

The solution for this issue was to remove the custom colors from NavigationBarItem and use the default ones. Now that this component is Material3 it will get the correct colors without additional setup. This fix both the issue and the UI that sometimes was not beautiful because of weird colors.

Also, the UX was improved by allowing dismiss on clicking outside the dialog. Previously, if the user clicks on the dialog and just wants to dismiss it, they need to click on the same item again.

@igorescodro igorescodro changed the title Fix Bottom Nav colors not updating after theme change 🎨 Fix Bottom Nav colors not updating after theme change May 31, 2023
@igorescodro igorescodro changed the title 🎨 Fix Bottom Nav colors not updating after theme change Fix Bottom Nav colors not updating after theme change May 31, 2023
This file was all alone in the root of preference module. Now it is
where it belongs.
Previously we had a better user experience by not allowing that. If the
user clicks on the dialog and just want to dismiss it, they need to
click on the same item again. Now it's possible to dismiss it like any
other regular dialog.
When updating the system theme under the Preference screen, the colors
in the Bottom Nav would remain the previous one until the app
recomposes. It's weird because the theme change is trigger the high
level recomposition and updating all subsequent components.

The solution for this issue was to remove the custom colors from
`NavigationBarItem` and use the default ones. Now that this component is
Material3 it will get the correct colors without additional setup. This
fix both the issue and the UI that sometimes was not beautiful because
of weird colors.
@igorescodro igorescodro merged commit 5bb14e2 into main Jun 1, 2023
4 of 5 checks passed
@igorescodro igorescodro deleted the fix-app-theme branch June 1, 2023 14:45
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

Successfully merging this pull request may close these issues.

None yet

1 participant