Remove placeholder image while loading thumbnails
This commit is contained in:
parent
12ad678d14
commit
5fb360a36e
1 changed files with 10 additions and 4 deletions
|
|
@ -157,9 +157,15 @@ public final class PicassoHelper {
|
||||||
|
|
||||||
|
|
||||||
private static RequestCreator loadImageDefault(final String url, final int placeholderResId) {
|
private static RequestCreator loadImageDefault(final String url, final int placeholderResId) {
|
||||||
return picassoInstance
|
if (!shouldLoadImages || isBlank(url)) {
|
||||||
.load((!shouldLoadImages || isBlank(url)) ? null : url)
|
return picassoInstance
|
||||||
.placeholder(placeholderResId)
|
.load((String) null)
|
||||||
.error(placeholderResId);
|
.placeholder(placeholderResId) // show placeholder when no image should load
|
||||||
|
.error(placeholderResId);
|
||||||
|
} else {
|
||||||
|
return picassoInstance
|
||||||
|
.load(url)
|
||||||
|
.error(placeholderResId); // don't show placeholder while loading, only on error
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue