Remove placeholder image while loading thumbnails

This commit is contained in:
Stypox 2021-08-10 09:46:32 +02:00
parent 6eaff5ca6a
commit 44128f9145
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 10 additions and 4 deletions

View File

@ -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) {
if (!shouldLoadImages || isBlank(url)) {
return picassoInstance return picassoInstance
.load((!shouldLoadImages || isBlank(url)) ? null : url) .load((String) null)
.placeholder(placeholderResId) .placeholder(placeholderResId) // show placeholder when no image should load
.error(placeholderResId); .error(placeholderResId);
} else {
return picassoInstance
.load(url)
.error(placeholderResId); // don't show placeholder while loading, only on error
}
} }
} }