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
Add a method to pass an image thumbnail URL as placeholder #383
Comments
This is exactly the same as calling Picasso twice with the same URL but
|
Not really, I have the same requirement Reusing the thumbnail url as a placeholder when displaying the bigger one then make sense... |
We can't retrieve the placeholder in that fashion. It is not indexed solely
|
not exactly as calling Picasso twice. the idea behind it is that the placeholder will be a blurred image representative of the actual final image being downloaded. Of course someone could think a better name for the methods, but I reckon it's a very valid use case and a feature lot of people would benefit from. |
We cannot look up the smaller image. Much more goes into caching than just Jake Wharton On Wed, Feb 5, 2014 at 8:14 AM, ronaldoeyeem notifications@github.comwrote:
|
I'll give a try to chain 2 picasso requests, one to load the thumbnail and capture its bitmap with its into() callback (which is supposed to be fast) but do not display it, then hand it to the second request as placeholder for the larger image. |
I reckon that chaining calls, although possible, is somewhat a redundant. If it's not possible to get from the cache using the URL somehow as a key, then it's better left to individual devs to call something like
But that approach limits a bit the implementation and I thought it could have a more elegant way to do it from within the library |
It is a worthy feature for a better UX to show the thumbnail as a placeholder until the real image loads properly, & I'm sure that @JakeWharton & others who contributed to this great library can do this extra boost :) but using a nested calls like the following, I think it is not the best solution from performance point of view: Picasso.with(context)
.load(thumb) // thumbnail url goes here
.into(imageView, new Callback() {
@Override
public void onSuccess() {
Picasso.with(context)
.load(url) // image url goes here
.placeholder(imageView.getDrawable())
.into(imageView);
}
@Override
public void onError() {
}
}); |
I'had a same problem.. I'll click a thumbImg in a listView to jump to another Activity with bigImg. The code should like this:
but I don't know to how to getCachedDrawable(). |
Anyone had a luck with this? |
@VishalNarvani the code I posted earlier works fine with me. |
@Abdelhady Your solution works perfectly. I'm able to load a thumbnail and subsequently a full sized image in sequence using your solution. Many thanks. |
What if i dont have a thumb url |
It would be a good feature, Just like what instagram does. I'm not a fan of nested calls, Does the fade animation works fine? |
We have no plans to do this. That being said, you can already accomplish this with concurrent requests, a listener, and cancelation. |
There're several use cases where apps shows a thumbnail image and
onClick()
it expands to a full sized image.It would be a great feature to be able to easily smooth transition between those two states by calling:
In that case, Picasso would
The text was updated successfully, but these errors were encountered: