use of com.bumptech.glide.load.resource.bitmap.FitCenter in project AntennaPod by AntennaPod.
the class ItemFragment method updateAppearance.
private void updateAppearance() {
if (item == null) {
Log.d(TAG, "updateAppearance item is null");
return;
}
txtvPodcast.setText(item.getFeed().getTitle());
txtvTitle.setText(item.getTitle());
if (item.getPubDate() != null) {
String pubDateStr = DateFormatter.formatAbbrev(getActivity(), item.getPubDate());
txtvPublished.setText(pubDateStr);
txtvPublished.setContentDescription(DateFormatter.formatForAccessibility(getContext(), item.getPubDate()));
}
RequestOptions options = new RequestOptions().error(R.color.light_gray).diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY).transforms(new FitCenter(), new RoundedCorners((int) (4 * getResources().getDisplayMetrics().density))).dontAnimate();
Glide.with(getActivity()).load(item.getImageLocation()).error(Glide.with(getActivity()).load(ImageResourceUtils.getFallbackImageLocation(item)).apply(options)).apply(options).into(imgvCover);
updateButtons();
}
Aggregations