Search in sources :

Example 6 with FitCenter

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();
}
Also used : RequestOptions(com.bumptech.glide.request.RequestOptions) FitCenter(com.bumptech.glide.load.resource.bitmap.FitCenter) RoundedCorners(com.bumptech.glide.load.resource.bitmap.RoundedCorners)

Aggregations

FitCenter (com.bumptech.glide.load.resource.bitmap.FitCenter)6 RoundedCorners (com.bumptech.glide.load.resource.bitmap.RoundedCorners)5 RequestOptions (com.bumptech.glide.request.RequestOptions)5 Bitmap (android.graphics.Bitmap)1 Drawable (android.graphics.drawable.Drawable)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 NonNull (androidx.annotation.NonNull)1 MainActivity (de.danoeh.antennapod.activity.MainActivity)1 PodcastSearchResult (de.danoeh.antennapod.discovery.PodcastSearchResult)1 Chapter (de.danoeh.antennapod.model.feed.Chapter)1 GpodnetPodcast (de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetPodcast)1