-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Also pass "boolean fromCache" to the Target interface #47
Comments
This sounds reasonable to me. It seems like there is a lot of overlap between what people want to do in onImageReady in the target and what they want to do in onImageReady in the callback. I don't have any great ideas for resolving it thought. |
What was your initial idea about the ResponseListener, Target and the ready callback? |
Ideally Target would be a very simple wrapper with little to no logic that basically just decouples the load from the thing receiving the load and the response listener would be where any more complex logic would go. I think the problem is that it will always be difficult to get at the underlying object in the response listener which makes it hard to do anything more complex, like the crossfade animation. In turn that probably makes extending Target as you've done the best way to go. |
See my last comment here: #48 |
Hi @sjudd, any objection in doing a PR to slightly change the Target interface to add the fromCache boolean?
Before I was relying in the ImageReadyCallback to set a flag in the target like:
The proposed approach would be:
But now the callback is called after the
target.onImageReady
. Since I have custom animations using aTransitionDrawable
with a cross fade the normalsetAnimation
scheme doesn't work anymore.So my big question is, any big reason why the
fromCache
argument could not fit in terms of the structure you initially idealized?As an example, my current ImageViewTarget is something like this:
Thanks!
The text was updated successfully, but these errors were encountered: