Use @DrawableRes in PicassoHelper

This commit is contained in:
Stypox 2023-09-19 18:35:29 +02:00
parent 0a2d6d1d62
commit 027b829c38
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 4 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.util.Log;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.graphics.BitmapCompat;
@ -190,17 +191,17 @@ public final class PicassoHelper {
private static RequestCreator loadImageDefault(@NonNull final List<Image> images,
final int placeholderResId) {
@DrawableRes final int placeholderResId) {
return loadImageDefault(choosePreferredImage(images), placeholderResId);
}
private static RequestCreator loadImageDefault(@Nullable final String url,
final int placeholderResId) {
@DrawableRes final int placeholderResId) {
return loadImageDefault(url, placeholderResId, true);
}
private static RequestCreator loadImageDefault(@Nullable final String url,
final int placeholderResId,
@DrawableRes final int placeholderResId,
final boolean showPlaceholderWhileLoading) {
// if the URL was chosen with `choosePreferredImage` it will be null, but check again
// `shouldLoadImages` in case the URL was chosen with `imageListToDbUrl` (which is the case