-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Should #placeholder(int) and #error(int) support theme attribute? #1275
Comments
I hate to +1, but +1. |
This is going to be hard to do elegantly. Ideally callers to Otherwise it's |
How about a context-depended member (say
Any |
Correct me if I'm wrong, but I believe WeakHashMap has strong references to Maybe adding a withTheme() to the RequestBuilder and burdening the caller On Wed, 27 Jan 2016, 07:16 Nam Nguyen Hoai notifications@github.com wrote:
|
I just realize that and trying another approach ... |
Since resource handling is the only loading that cares about the theme, I would think an ideal API would be something like |
In that case it would be an overload for all load methods, as placeholder and error images can also be resources. |
After some thought, I notice that almost the UI stuff is done in |
By the way, Maven will need to be dropped before any changes here can happen, anyway. |
Bitmap is generally downloaded result. When you pass in your custom placeholder resource and error image resource, it would be accessed as Drawable (BitmapDrawable is the one to wrap a Bitmap). What does your statement |
Not strictly true, but for convenient access to the newer APIs, yes. On Thu, Jan 28, 2016, 8:51 PM Nam Nguyen Hoai notifications@github.com
|
Is there a reason |
It can, but what about into(Target)? On Mon, Mar 14, 2016, 6:43 PM LorneLaliberte notifications@github.com
|
Just be curious, as picasso 2 are really well formed (Really neat, I would like to say that), do you have any future plan for a fresh new release? |
It would probably need to remain unthemed, unless you were willing to break compatibility by adding Another approach would be to do what you mentioned and add another method to pass the theme or context in, but rather than |
Since I just see your 3.0 milestone, any chance this "issue" will be taken care of? Thanks. |
One more data point, something changed between Android N and Android O theme resolution for night mode colors. We are using night mode resource loading with Picasso. Particularly we are doing
With android N and below the
I'm assuming something changed in how themes are resolved in O that is causing this issue but I wasn't sure where to report |
This is WAI -- due to multi-window support, Resources objects in O+ can exist against multiple configurations within the same application. |
As of the code on master we finally have the ability to change this. We not
longer require a Context for the with() call and can add overloads or new
methods which take a Context for loading.
…On Thu, Jul 20, 2017, 10:01 PM Alan Viverette ***@***.***> wrote:
picasso's request creator using the context from when the picasso instance
was instantiated to resolve placeholder drawables
This is WAI -- due to multi-window support, Resources objects in O+ can
exist against multiple configurations within the same application.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1275 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEb6Oxd12fKiO-jZm_8lq0_i8q14gks5sP8A7gaJpZM4HLI1z>
.
|
I have this night theme bug in 2.8. I have an vector drawable which I tint with a theme attribute: This causes a strange behavior/bug when I use the same drawable resource id for error and placeholder. The placeholder will use the day theme and the error the dark theme. |
Theme customization does not seem to work well with Picasso: square/picasso#1275
Theme customization does not seem to work well with Picasso: square/picasso#1275
Theme customization does not seem to work well with Picasso: square/picasso#1275
I'm using picasso 3.0.0-alpha05, and this bug is still there. I have a vector image in xml, and it uses certain colors. These colors are different in If the system is using one mode (e.g. MODE_NIGHT_NO), but the app uses a different mode (e.g. MODE_NIGHT_YES) that was set using I tried using same resource id for Instead of having two colors and one vector xml, I tried having two vector xml files for light and night mode each. It didn't work anyway. The only thing that worked for me is using It's almost 2024, and this bug was around for so long. Dark mode support should be de facto by now. Please, have mercy! |
Hi @rekire, could you please share your workaround? |
I mean in case we want some theme-depended drawable (vector, for example, which could be passed theme's color as attribute, not constant color value). By that a placeholder's drawable could be "lighter" in dark theme, and "darker" in light theme, dynamically. (IMO, caching a placeholder drawable is not necessary, as it doesn't consume too much resource).
The problem now is: Picasso will use a final ApplicationContext for its #getDrawable() action, which will not listen to theme's attributes.
Don't know if you are interested in theming and support libraries or not, but it would be nice if Picasso supports something like
ContextCompat.getDrawable()
.The text was updated successfully, but these errors were encountered: