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: 'changeToolbarColorOnScroll' crash #2089

Closed
wants to merge 1 commit into from

Conversation

NicolasBourdin88
Copy link
Contributor

No description provided.

@NicolasBourdin88 NicolasBourdin88 added bug Something isn't working quick A pull request consisting of a few lines labels Nov 1, 2024
@NicolasBourdin88 NicolasBourdin88 self-assigned this Nov 1, 2024
Copy link

sonarcloud bot commented Nov 1, 2024

Comment on lines +495 to +497
if (shouldUpdateStatusBar()) {
viewLifecycleOwner.lifecycleScope.launch(Dispatchers.Main) { requireActivity().window.statusBarColor = color }
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, this should have already been fixed, I don't understand.

There's a already a Dispatchers.Main inside animateColorChange(), there should be no point in adding a second one here, why is it not enough?

Also, there should be other lines of code that will crash if not on the main Thread such as toolbar.setBackgroundColor(color) and otherUpdates?.invoke(color). Do they not crash?

@NicolasBourdin88
Copy link
Contributor Author

Already fixed

@NicolasBourdin88 NicolasBourdin88 deleted the fix-called-from-wrong-thread branch November 18, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working quick A pull request consisting of a few lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants