summaryrefslogtreecommitdiff
path: root/ui/glide
diff options
context:
space:
mode:
authorGitStart <1501599+gitstart@users.noreply.github.com>2023-02-11 19:04:14 +0100
committerGitHub <noreply@github.com>2023-02-11 19:04:14 +0100
commit4096aaf47ea6f0341274e82fc14c5a3960a83f5f (patch)
tree93f185ba8c144dbaaadd02143456fc9c7b64f9fd /ui/glide
parentf9839aba99808c453fe2daa04b08652ae750b18a (diff)
downloadAntennaPod-4096aaf47ea6f0341274e82fc14c5a3960a83f5f.zip
Convert subscriptions screen to cards (#6261)
Diffstat (limited to 'ui/glide')
-rw-r--r--ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/ApGlideModule.java2
-rw-r--r--ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmap.java20
-rw-r--r--ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmapResource.java40
-rw-r--r--ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmapTranscoder.java31
4 files changed, 0 insertions, 93 deletions
diff --git a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/ApGlideModule.java b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/ApGlideModule.java
index d233fba14..132ed4901 100644
--- a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/ApGlideModule.java
+++ b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/ApGlideModule.java
@@ -2,7 +2,6 @@ package de.danoeh.antennapod.ui.glide;
import android.annotation.SuppressLint;
import android.content.Context;
-import android.graphics.Bitmap;
import android.util.Log;
import androidx.annotation.NonNull;
@@ -51,6 +50,5 @@ public class ApGlideModule extends AppGlideModule {
registry.append(String.class, InputStream.class, new NoHttpStringLoader.StreamFactory());
registry.append(EmbeddedChapterImage.class, ByteBuffer.class, new ChapterImageModelLoader.Factory());
- registry.register(Bitmap.class, PaletteBitmap.class, new PaletteBitmapTranscoder());
}
}
diff --git a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmap.java b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmap.java
deleted file mode 100644
index a3b590ba2..000000000
--- a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmap.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Source: https://github.com/bumptech/glide/wiki/Custom-targets#palette-example
- */
-
-package de.danoeh.antennapod.ui.glide;
-
-import android.graphics.Bitmap;
-
-import androidx.annotation.NonNull;
-import androidx.palette.graphics.Palette;
-
-public class PaletteBitmap {
- public final Palette palette;
- public final Bitmap bitmap;
-
- public PaletteBitmap(@NonNull Bitmap bitmap, Palette palette) {
- this.bitmap = bitmap;
- this.palette = palette;
- }
-} \ No newline at end of file
diff --git a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmapResource.java b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmapResource.java
deleted file mode 100644
index 2fd18a0cb..000000000
--- a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmapResource.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Source: https://github.com/bumptech/glide/wiki/Custom-targets#palette-example
- */
-
-package de.danoeh.antennapod.ui.glide;
-
-import androidx.annotation.NonNull;
-
-import com.bumptech.glide.load.engine.Resource;
-import com.bumptech.glide.util.Util;
-
-public class PaletteBitmapResource implements Resource<PaletteBitmap> {
- private final PaletteBitmap paletteBitmap;
-
- public PaletteBitmapResource(@NonNull PaletteBitmap paletteBitmap) {
- this.paletteBitmap = paletteBitmap;
- }
-
- @NonNull
- @Override
- public Class<PaletteBitmap> getResourceClass() {
- return PaletteBitmap.class;
- }
-
- @NonNull
- @Override
- public PaletteBitmap get() {
- return paletteBitmap;
- }
-
- @Override
- public int getSize() {
- return Util.getBitmapByteSize(paletteBitmap.bitmap);
- }
-
- @Override
- public void recycle() {
- paletteBitmap.bitmap.recycle();
- }
-} \ No newline at end of file
diff --git a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmapTranscoder.java b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmapTranscoder.java
deleted file mode 100644
index bcb5f590a..000000000
--- a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/PaletteBitmapTranscoder.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Source: https://github.com/bumptech/glide/wiki/Custom-targets#palette-example
- */
-
-package de.danoeh.antennapod.ui.glide;
-
-import android.graphics.Bitmap;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.palette.graphics.Palette;
-
-import com.bumptech.glide.load.Options;
-import com.bumptech.glide.load.engine.Resource;
-import com.bumptech.glide.load.resource.transcode.ResourceTranscoder;
-import de.danoeh.antennapod.storage.preferences.UserPreferences;
-
-public class PaletteBitmapTranscoder implements ResourceTranscoder<Bitmap, PaletteBitmap> {
-
- @Nullable
- @Override
- public Resource<PaletteBitmap> transcode(@NonNull Resource<Bitmap> toTranscode, @NonNull Options options) {
- Bitmap bitmap = toTranscode.get();
- Palette palette = null;
- if (UserPreferences.shouldShowSubscriptionTitle()) {
- palette = new Palette.Builder(bitmap).generate();
- }
- PaletteBitmap result = new PaletteBitmap(bitmap, palette);
- return new PaletteBitmapResource(result);
- }
-}