diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-11-10 22:00:49 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-11-10 22:00:49 +0100 |
commit | 99068c82ccf1ac03153e5eb6e79ff2c610caf3cf (patch) | |
tree | c067d370a9b3d11d1b69632c37300bb2a0c3d55a /app/src | |
parent | ad04a80ae7b2091c94b0d007c2a78d97e7af871d (diff) | |
download | AntennaPod-99068c82ccf1ac03153e5eb6e79ff2c610caf3cf.zip |
Updated picasso library
Use RequestHandler instead of Downloader for extracting bitmaps from media files
Diffstat (limited to 'app/src')
13 files changed, 53 insertions, 29 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/PodcastApp.java b/app/src/main/java/de/danoeh/antennapod/PodcastApp.java index 87474dbdd..451094909 100644 --- a/app/src/main/java/de/danoeh/antennapod/PodcastApp.java +++ b/app/src/main/java/de/danoeh/antennapod/PodcastApp.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod; import android.app.Application; import android.content.res.Configuration; +import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.preferences.UserPreferences; @@ -36,6 +37,7 @@ public class PodcastApp extends Application { singleton = this; LOGICAL_DENSITY = getResources().getDisplayMetrics().density; + PicassoProvider.setupPicassoInstance(this); UserPreferences.createInstance(this); PlaybackPreferences.createInstance(this); EventDistributor.getInstance(); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java index 9979896f6..eb7a844db 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -25,13 +25,14 @@ import android.widget.ImageView.ScaleType; import android.widget.ListView; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import org.apache.commons.lang3.StringUtils; import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.ChapterListAdapter; import de.danoeh.antennapod.adapter.NavListAdapter; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.Feed; @@ -383,7 +384,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc @Override public void run() { - PicassoProvider.getMediaMetadataPicassoInstance(AudioplayerActivity.this) + Picasso.with(AudioplayerActivity.this) .load(media.getImageUri()) .fit() .into(butNavLeft); @@ -400,7 +401,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc @Override public void run() { - PicassoProvider.getMediaMetadataPicassoInstance(AudioplayerActivity.this) + Picasso.with(AudioplayerActivity.this) .load(media.getImageUri()) .fit() .into(butNavLeft); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java index 5e3817796..d265c05b1 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java @@ -17,6 +17,8 @@ import android.widget.ListView; import android.widget.Spinner; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import org.apache.commons.lang3.StringUtils; import org.jsoup.Jsoup; import org.jsoup.examples.HtmlToPlainText; @@ -30,7 +32,6 @@ import java.util.Map; import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.FeedItemlistDescriptionAdapter; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.Feed; @@ -123,7 +124,7 @@ public class DefaultOnlineFeedViewActivity extends OnlineFeedViewActivity { subscribeButton = (Button) header.findViewById(R.id.butSubscribe); if (feed.getImage() != null && StringUtils.isNoneBlank(feed.getImage().getDownload_url())) { - PicassoProvider.getDefaultPicassoInstance(this) + Picasso.with(this) .load(feed.getImage().getDownload_url()) .fit() .into(cover); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java index 3000cfaeb..93c71a868 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -9,10 +9,16 @@ import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import android.widget.*; +import android.widget.CheckBox; +import android.widget.CompoundButton; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +import com.squareup.picasso.Picasso; + import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedPreferences; @@ -78,7 +84,7 @@ public class FeedInfoActivity extends ActionBarActivity { @Override public void run() { - PicassoProvider.getDefaultPicassoInstance(FeedInfoActivity.this) + Picasso.with(FeedInfoActivity.this) .load(feed.getImageUri()) .fit() .into(imgvCover); @@ -167,7 +173,7 @@ public class FeedInfoActivity extends ActionBarActivity { super.onPrepareOptionsMenu(menu); menu.findItem(R.id.support_item).setVisible( feed != null && feed.getPaymentLink() != null); - menu.findItem(R.id.share_link_item).setVisible(feed != null &&feed.getLink() != null); + menu.findItem(R.id.share_link_item).setVisible(feed != null && feed.getLink() != null); menu.findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null); return true; } 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 3af9bdcda..15e0a7a33 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java @@ -10,8 +10,9 @@ import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.util.Converter; @@ -87,7 +88,7 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter { holder.butSecondary.setOnClickListener(secondaryActionListener); - PicassoProvider.getMediaMetadataPicassoInstance(context) + Picasso.with(context) .load(item.getImageUri()) .fit() .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 cbe7665fd..a0ba0f794 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -11,8 +11,9 @@ import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.feed.Feed; /** @@ -180,7 +181,7 @@ public class NavListAdapter extends BaseAdapter { holder.title.setText(feed.getTitle()); - PicassoProvider.getDefaultPicassoInstance(context) + Picasso.with(context) .load(feed.getImageUri()) .fit() .into(holder.image); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java index 171f82114..1f98ec158 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java @@ -11,8 +11,9 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.storage.DownloadRequester; @@ -133,7 +134,7 @@ public class NewEpisodesListAdapter extends BaseAdapter { holder.butSecondary.setTag(item); holder.butSecondary.setOnClickListener(secondaryActionListener); - PicassoProvider.getMediaMetadataPicassoInstance(context) + Picasso.with(context) .load(item.getImageUri()) .fit() .into(holder.imageView); 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 bc42ad063..d5b85575b 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueListAdapter.java @@ -4,9 +4,15 @@ import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.*; +import android.widget.BaseAdapter; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.squareup.picasso.Picasso; + import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.storage.DownloadRequester; @@ -92,7 +98,7 @@ public class QueueListAdapter extends BaseAdapter { holder.butSecondary.setTag(item); holder.butSecondary.setOnClickListener(secondaryActionListener); - PicassoProvider.getMediaMetadataPicassoInstance(context) + Picasso.with(context) .load(item.getImageUri()) .fit() .into(holder.imageView); 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 79c1f6f99..cedce7903 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java @@ -8,8 +8,9 @@ import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedComponent; import de.danoeh.antennapod.core.feed.FeedItem; @@ -72,7 +73,7 @@ public class SearchlistAdapter extends BaseAdapter { holder.title.setText(feed.getTitle()); holder.subtitle.setVisibility(View.GONE); - PicassoProvider.getDefaultPicassoInstance(context) + Picasso.with(context) .load(feed.getImageUri()) .fit() .into(holder.cover); @@ -85,7 +86,7 @@ public class SearchlistAdapter extends BaseAdapter { holder.subtitle.setText(result.getSubtitle()); } - PicassoProvider.getDefaultPicassoInstance(context) + Picasso.with(context) .load(item.getFeed().getImageUri()) .fit() .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 8549f4f7a..51569e92e 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 @@ -8,12 +8,13 @@ import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import org.apache.commons.lang3.StringUtils; import java.util.List; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetPodcast; /** @@ -49,7 +50,7 @@ public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> { holder.title.setText(podcast.getTitle()); if (StringUtils.isNoneBlank(podcast.getLogoUrl())) { - PicassoProvider.getDefaultPicassoInstance(convertView.getContext()) + Picasso.with(convertView.getContext()) .load(podcast.getLogoUrl()) .fit() .into(holder.image); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index 69bd2b099..efe3e7ab4 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -9,10 +9,11 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import com.squareup.picasso.Picasso; + import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.AudioplayerActivity.AudioplayerContentFragment; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.util.playback.Playable; /** @@ -68,7 +69,7 @@ public class CoverFragment extends Fragment implements public void run() { Context c = getActivity(); if (c != null) { - PicassoProvider.getMediaMetadataPicassoInstance(c) + Picasso.with(c) .load(media.getImageUri()) .into(imgvCover); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index 99320cffa..a42658057 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -11,9 +11,10 @@ import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.playback.Playable; @@ -207,7 +208,7 @@ public class ExternalPlayerFragment extends Fragment { if (media != null) { txtvTitle.setText(media.getEpisodeTitle()); - PicassoProvider.getMediaMetadataPicassoInstance(getActivity()) + Picasso.with(getActivity()) .load(media.getImageUri()) .fit() .into(imgvCover); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java index abf894c2a..be9a9c12d 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -21,6 +21,8 @@ import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; +import com.squareup.picasso.Picasso; + import org.apache.commons.lang3.Validate; import java.util.List; @@ -33,7 +35,6 @@ import de.danoeh.antennapod.adapter.DefaultActionButtonCallback; import de.danoeh.antennapod.adapter.FeedItemlistAdapter; import de.danoeh.antennapod.core.asynctask.DownloadObserver; import de.danoeh.antennapod.core.asynctask.FeedRemover; -import de.danoeh.antennapod.core.asynctask.PicassoProvider; import de.danoeh.antennapod.core.dialog.ConfirmationDialog; import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator; import de.danoeh.antennapod.core.feed.EventDistributor; @@ -367,7 +368,7 @@ public class ItemlistFragment extends ListFragment { txtvTitle.setText(feed.getTitle()); txtvAuthor.setText(feed.getAuthor()); - PicassoProvider.getDefaultPicassoInstance(getActivity()) + Picasso.with(getActivity()) .load(feed.getImageUri()) .fit() .into(imgvCover); |