I'm using the Picasso library from Square to load a URL string into an ImageView. I'm calling this several times on an array or URLs with a Timer to change the ImageView image.
The first time though, when Picasso is loading the URL content, every time the ImageView updates, it flashes white.
After Picasso caches the content, the ImageView changes without the flash.
How do I stop the ImageView from flashing white?
Picasso.with(getApplicationContext()).load(currentUrl).into(img, new Callback() {
@Override
public void onSuccess() {
mProgress.dismiss();
}
@Override
public void onError() {
mProgress.dismiss();
}
});
Image loading using Picasso is very easy, you can do it like this way Picasso. get(). load("http://i.imgur.com/DvpvklR.png").into(imageView); and in their website you can get every details. In your case you can parse every image URL and use RecyclerView to show them along with Picasso.
Had the same issue, solved it by adding the noPlaceHolder instruction like this :
Picasso.with(getApplicationContext())
.load(currentUrl)
.noPlaceholder()
.into(img, new Callback() {
@Override
public void onSuccess() {
mProgress.dismiss();
}
@Override
public void onError() {
mProgress.dismiss();
}
});
By default, Picasso will either clear the target ImageView in order to ensure behavior in situations where views are recycled. This method will prevent that behavior and retain any already set image.
Picasso Documentaton
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With