diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-08-08 17:48:24 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-08-08 17:48:24 -0400 |
commit | b332942f161f598d2c3247bdd073765a8ad51662 (patch) | |
tree | 1b89d33fc8e8f4f3aa63465abcc652b56f93ff4d /app/src/main/java/de/danoeh/antennapod/adapter | |
parent | e2076103738b7577c19ac65af966a11826648c84 (diff) | |
parent | 4832b1aeb28d29644169022bc2ec8196809a9858 (diff) | |
download | AntennaPod-b332942f161f598d2c3247bdd073765a8ad51662.zip |
Merge pull request #1071 from TomHennen/cacheallimages
Cache all images (should reduce lag displaying lists of episodes)
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/adapter')
6 files changed, 15 insertions, 9 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesListAdapter.java index aebcc5e41..4b6ee8f91 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesListAdapter.java @@ -24,6 +24,7 @@ import java.lang.ref.WeakReference; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; +import de.danoeh.antennapod.core.glide.ApGlideSettings; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.Converter; @@ -154,7 +155,7 @@ public class AllEpisodesListAdapter extends BaseAdapter { Glide.with(context) .load(item.getImageUri()) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(new CoverTarget(item.getFeed().getImageUri(), holder.placeholder, holder.cover)); @@ -183,7 +184,7 @@ public class AllEpisodesListAdapter extends BaseAdapter { if(fallbackUri != null && txtvPlaceholder != null && imgvCover != null) { Glide.with(context) .load(fallbackUri) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(new CoverTarget(null, txtvPlaceholder, imgvCover)); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java index 0cf761503..2b1eccea5 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java @@ -15,6 +15,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItem; +import de.danoeh.antennapod.core.glide.ApGlideSettings; import de.danoeh.antennapod.core.util.Converter; /** @@ -93,7 +94,7 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter { .load(item.getImageUri()) .placeholder(R.color.light_gray) .error(R.color.light_gray) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(holder.imageView); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index a063ad9b1..3c91cbbbb 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -28,6 +28,7 @@ import java.util.List; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.core.feed.Feed; +import de.danoeh.antennapod.core.glide.ApGlideSettings; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.fragment.AddFeedFragment; import de.danoeh.antennapod.fragment.AllEpisodesFragment; @@ -264,7 +265,7 @@ public class NavListAdapter extends BaseAdapter .load(feed.getImageUri()) .placeholder(R.color.light_gray) .error(R.color.light_gray) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(holder.image); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java index 81208749a..60c125fda 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java @@ -25,6 +25,7 @@ import java.lang.ref.WeakReference; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; +import de.danoeh.antennapod.core.glide.ApGlideSettings; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.Converter; @@ -157,7 +158,7 @@ public class QueueListAdapter extends BaseAdapter { Glide.with(context) .load(item.getImageUri()) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(new CoverTarget(item.getFeed().getImageUri(), holder.placeholder, holder.cover)); @@ -186,7 +187,7 @@ public class QueueListAdapter extends BaseAdapter { if(fallbackUri != null && txtvPlaceholder != null && imgvCover != null) { Glide.with(context) .load(fallbackUri) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(new CoverTarget(null, txtvPlaceholder, imgvCover)); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java index 8c1464e97..83f5dcb4d 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java @@ -16,6 +16,7 @@ import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedComponent; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.SearchResult; +import de.danoeh.antennapod.core.glide.ApGlideSettings; /** * List adapter for search activity. @@ -78,7 +79,7 @@ public class SearchlistAdapter extends BaseAdapter { .load(feed.getImageUri()) .placeholder(R.color.light_gray) .error(R.color.light_gray) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(holder.cover); @@ -95,7 +96,7 @@ public class SearchlistAdapter extends BaseAdapter { .load(item.getFeed().getImageUri()) .placeholder(R.color.light_gray) .error(R.color.light_gray) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(holder.cover); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java index b9993b455..743f9fc86 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java @@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; import java.util.List; import de.danoeh.antennapod.R; +import de.danoeh.antennapod.core.glide.ApGlideSettings; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetPodcast; /** @@ -54,7 +55,7 @@ public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> { .load(podcast.getLogoUrl()) .placeholder(R.color.light_gray) .error(R.color.light_gray) - .diskCacheStrategy(DiskCacheStrategy.SOURCE) + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate() .into(holder.image); |