Call fit() instead of resize()
This commit is contained in:
parent
4002fc4bba
commit
dccbfea114
|
@ -382,6 +382,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc
|
|||
public void run() {
|
||||
PicassoProvider.getMediaMetadataPicassoInstance(AudioplayerActivity.this)
|
||||
.load(media.getImageUri())
|
||||
.fit()
|
||||
.into(butNavLeft);
|
||||
}
|
||||
});
|
||||
|
@ -398,6 +399,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc
|
|||
public void run() {
|
||||
PicassoProvider.getMediaMetadataPicassoInstance(AudioplayerActivity.this)
|
||||
.load(media.getImageUri())
|
||||
.fit()
|
||||
.into(butNavLeft);
|
||||
}
|
||||
|
||||
|
|
|
@ -123,10 +123,9 @@ public class DefaultOnlineFeedViewActivity extends OnlineFeedViewActivity {
|
|||
subscribeButton = (Button) header.findViewById(R.id.butSubscribe);
|
||||
|
||||
if (feed.getImage() != null) {
|
||||
int imageSize = (int) getResources().getDimension(R.dimen.thumbnail_length);
|
||||
PicassoProvider.getDefaultPicassoInstance(this)
|
||||
.load(feed.getImage().getDownload_url())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(cover);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ public class FeedInfoActivity extends ActionBarActivity {
|
|||
public void run() {
|
||||
PicassoProvider.getDefaultPicassoInstance(FeedInfoActivity.this)
|
||||
.load(feed.getImageUri())
|
||||
.fit()
|
||||
.into(imgvCover);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -89,7 +89,7 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
|
|||
|
||||
PicassoProvider.getMediaMetadataPicassoInstance(context)
|
||||
.load(item.getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(holder.imageView);
|
||||
|
||||
return convertView;
|
||||
|
|
|
@ -176,7 +176,7 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter {
|
|||
|
||||
PicassoProvider.getMediaMetadataPicassoInstance(context)
|
||||
.load(item.getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(holder.feedImage);
|
||||
|
||||
holder.butAction.setFocusable(false);
|
||||
|
|
|
@ -32,8 +32,6 @@ public class NavListAdapter extends BaseAdapter {
|
|||
private ItemAccess itemAccess;
|
||||
private Context context;
|
||||
|
||||
private final int imageSize;
|
||||
|
||||
public NavListAdapter(ItemAccess itemAccess, Context context) {
|
||||
this.itemAccess = itemAccess;
|
||||
this.context = context;
|
||||
|
@ -43,7 +41,6 @@ public class NavListAdapter extends BaseAdapter {
|
|||
drawables = new Drawable[]{ta.getDrawable(0), ta.getDrawable(1), ta.getDrawable(2),
|
||||
ta.getDrawable(3), ta.getDrawable(4)};
|
||||
ta.recycle();
|
||||
this.imageSize = (int) context.getResources().getDimension(R.dimen.thumbnail_length_navlist);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -195,7 +192,7 @@ public class NavListAdapter extends BaseAdapter {
|
|||
|
||||
PicassoProvider.getDefaultPicassoInstance(context)
|
||||
.load(feed.getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(holder.image);
|
||||
|
||||
return convertView;
|
||||
|
|
|
@ -27,7 +27,6 @@ public class NewEpisodesListAdapter extends BaseAdapter {
|
|||
private final ItemAccess itemAccess;
|
||||
private final ActionButtonCallback actionButtonCallback;
|
||||
private final ActionButtonUtils actionButtonUtils;
|
||||
private final int imageSize;
|
||||
|
||||
public NewEpisodesListAdapter(Context context, ItemAccess itemAccess, ActionButtonCallback actionButtonCallback) {
|
||||
super();
|
||||
|
@ -35,7 +34,6 @@ public class NewEpisodesListAdapter extends BaseAdapter {
|
|||
this.itemAccess = itemAccess;
|
||||
this.actionButtonUtils = new ActionButtonUtils(context);
|
||||
this.actionButtonCallback = actionButtonCallback;
|
||||
this.imageSize = (int) context.getResources().getDimension(R.dimen.thumbnail_length_itemlist);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -133,7 +131,7 @@ public class NewEpisodesListAdapter extends BaseAdapter {
|
|||
|
||||
PicassoProvider.getMediaMetadataPicassoInstance(context)
|
||||
.load(item.getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(holder.imageView);
|
||||
|
||||
return convertView;
|
||||
|
|
|
@ -22,7 +22,6 @@ public class QueueListAdapter extends BaseAdapter {
|
|||
private final ActionButtonCallback actionButtonCallback;
|
||||
private final ActionButtonUtils actionButtonUtils;
|
||||
|
||||
private final int imageSize;
|
||||
|
||||
public QueueListAdapter(Context context, ItemAccess itemAccess, ActionButtonCallback actionButtonCallback) {
|
||||
super();
|
||||
|
@ -30,8 +29,6 @@ public class QueueListAdapter extends BaseAdapter {
|
|||
this.itemAccess = itemAccess;
|
||||
this.actionButtonUtils = new ActionButtonUtils(context);
|
||||
this.actionButtonCallback = actionButtonCallback;
|
||||
this.imageSize = (int) context.getResources().getDimension(R.dimen.thumbnail_length_queue_item);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -97,7 +94,7 @@ public class QueueListAdapter extends BaseAdapter {
|
|||
|
||||
PicassoProvider.getMediaMetadataPicassoInstance(context)
|
||||
.load(item.getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(holder.imageView);
|
||||
|
||||
return convertView;
|
||||
|
|
|
@ -23,12 +23,10 @@ public class SearchlistAdapter extends BaseAdapter {
|
|||
private final Context context;
|
||||
private final ItemAccess itemAccess;
|
||||
|
||||
private final int imageSize;
|
||||
|
||||
public SearchlistAdapter(Context context, ItemAccess itemAccess) {
|
||||
this.context = context;
|
||||
this.itemAccess = itemAccess;
|
||||
this.imageSize = (int) context.getResources().getDimension(R.dimen.thumbnail_length);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -76,7 +74,7 @@ public class SearchlistAdapter extends BaseAdapter {
|
|||
|
||||
PicassoProvider.getDefaultPicassoInstance(context)
|
||||
.load(feed.getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(holder.cover);
|
||||
|
||||
} else if (component.getClass() == FeedItem.class) {
|
||||
|
@ -89,7 +87,7 @@ public class SearchlistAdapter extends BaseAdapter {
|
|||
|
||||
PicassoProvider.getDefaultPicassoInstance(context)
|
||||
.load(item.getFeed().getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(holder.cover);
|
||||
|
||||
}
|
||||
|
|
|
@ -18,11 +18,9 @@ import de.danoeh.antennapod.gpoddernet.model.GpodnetPodcast;
|
|||
* Adapter for displaying a list of GPodnetPodcast-Objects.
|
||||
*/
|
||||
public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> {
|
||||
private final int thumbnailLength;
|
||||
|
||||
public PodcastListAdapter(Context context, int resource, List<GpodnetPodcast> objects) {
|
||||
super(context, resource, objects);
|
||||
thumbnailLength = (int) context.getResources().getDimension(R.dimen.thumbnail_length);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +50,7 @@ public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> {
|
|||
|
||||
PicassoProvider.getDefaultPicassoInstance(convertView.getContext())
|
||||
.load(podcast.getLogoUrl())
|
||||
.resize(thumbnailLength, thumbnailLength)
|
||||
.fit()
|
||||
.into(holder.image);
|
||||
|
||||
return convertView;
|
||||
|
|
|
@ -207,10 +207,9 @@ public class ExternalPlayerFragment extends Fragment {
|
|||
if (media != null) {
|
||||
txtvTitle.setText(media.getEpisodeTitle());
|
||||
|
||||
int imageSize = (int) getResources().getDimension(R.dimen.external_player_height);
|
||||
PicassoProvider.getMediaMetadataPicassoInstance(getActivity())
|
||||
.load(media.getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(imgvCover);
|
||||
|
||||
fragmentLayout.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -350,10 +350,9 @@ public class ItemlistFragment extends ListFragment {
|
|||
txtvTitle.setText(feed.getTitle());
|
||||
txtvAuthor.setText(feed.getAuthor());
|
||||
|
||||
int imageSize = (int) getResources().getDimension(R.dimen.thumbnail_length_onlinefeedview);
|
||||
PicassoProvider.getDefaultPicassoInstance(getActivity())
|
||||
.load(feed.getImageUri())
|
||||
.resize(imageSize, imageSize)
|
||||
.fit()
|
||||
.into(imgvCover);
|
||||
|
||||
if (feed.getLink() == null) {
|
||||
|
|
Loading…
Reference in New Issue