From 027b829c384be26494b2d2867dd285a51388213b Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 19 Sep 2023 18:35:29 +0200 Subject: [PATCH] Use @DrawableRes in PicassoHelper --- .../java/org/schabi/newpipe/util/image/PicassoHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/image/PicassoHelper.java b/app/src/main/java/org/schabi/newpipe/util/image/PicassoHelper.java index 904776580..4b116bdf9 100644 --- a/app/src/main/java/org/schabi/newpipe/util/image/PicassoHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/image/PicassoHelper.java @@ -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 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