1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-25 20:42:34 +01:00

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

View File

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