Is there a way to listen for events from Picasso when using the builder like:
Picasso.with(getContext()).load(url).into(imageView);
I'm trying to call requestLayout()
and invalidate()
on the parent GridView
so it'll resize properly but I don't know how to set a listener or callback.
I see that Picasso has error event reporting, but is there a success event?
You can use a Callback
to get onSuccess and onError events. Just add a new Callback to your request like so:
Picasso.with(getContext())
.load(url)
.into(imageView, new com.squareup.picasso.Callback() {
@Override
public void onSuccess() {
}
@Override
public void onError() {
}
});
Then you can perform any alterations and modifications in the onSuccess callback.