glide icon indicating copy to clipboard operation
glide copied to clipboard

fixed placeholders load drawable resources with wrong context

Open shijiayao-main opened this issue 3 years ago • 3 comments
trafficstars

…t mode

Description

issues #3778 #3751

fix unable to find night resources when using night mode

Motivation and Context

when using 'AppCompatDelegate.seDefaultNightMode' change theme mode, glide will not use the right resources.

in ContextThemeWrapper if mOverrideConfiguration is null it will get resource by 'mBase.getResources()', in 'DrawableDecoderCompat' mBase is applicationContext, should use 'applyOverrideConfiguration' to get resource from current theme.

ResourcesCompat.getDrawable() resource should use 'theme.getResources' rather than 'context.getResources' because context is applicationContext

shijiayao-main avatar Jul 20 '22 13:07 shijiayao-main

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jul 20 '22 13:07 google-cla[bot]

@sjudd this commit is necessary for us. would you release a version?

Haoxiqiang avatar Jul 22 '22 06:07 Haoxiqiang

Thank you for the fix! Would you be willing to add a test case for this?

kanelbulle avatar Aug 03 '22 00:08 kanelbulle

What about merging this branch with the main? The whole library is unusable for us using the dark mode

osfunapps avatar Oct 09 '22 14:10 osfunapps