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

Apply the current Theme for Uri and resource ids. #4979

Merged

Conversation

sjudd
Copy link
Collaborator

@sjudd sjudd commented Dec 24, 2022

Applying the Theme allows us to respect the Theme, including dark or light mode resources. We're making the same compromise here that we've made for other model types. Specifically we're only applying this behavior if the non-generic version of the method is used, ie the type of the model is known at compile time.

We could try to do this at a lower level, but there's some additional risk of confusion about when or why the Theme is or isn't available. While this isn't perfectly consistent, the behavior can at least be well documented.

There's also some risk that passing the Context's Resources / Theme classes to a background thread will result in transient memory leaks. I don't immediately see a direct link between either class and the enclosing Context, but it's hard to be certain.

Progress towards #3751

Description

Motivation and Context

@sjudd sjudd added the import-ready Indicates the PR is ready to be imported to Google. label Dec 24, 2022
Applying the Theme allows us to respect the Theme, including dark or
light mode resources. We're making the same compromise here that we've
made for other model types. Specifically we're only applying this
behavior if the non-generic version of the method is used, ie the type
of the model is known at compile time.

We could try to do this at a lower level, but there's some additional
risk of confusion about when or why the Theme is or isn't available.
While this isn't perfectly consistent, the behavior can at least be well
documented.

There's also some risk that passing the Context's Resources / Theme
classes to a background thread will result in transient memory leaks. I
don't immediately see a direct link between either class and the
enclosing Context, but it's hard to be certain.

Progress towards bumptech#3751
@sjudd sjudd force-pushed the apply_current_theme_uri_resource_ids branch from 4a8f28b to 9668157 Compare December 29, 2022 23:08
@copybara-service copybara-service bot merged commit c9f76cc into bumptech:master Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-ready Indicates the PR is ready to be imported to Google.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant