Search in sources :

Example 1 with PaletteBitmap

use of de.danoeh.antennapod.core.glide.PaletteBitmap in project AntennaPod by AntennaPod.

the class CoverLoader method load.

public void load() {
    CoverTarget coverTarget = new CoverTarget(txtvPlaceholder, imgvCover, textAndImageCombined);
    if (resource != 0) {
        Glide.with(activity).clear(coverTarget);
        imgvCover.setImageResource(resource);
        CoverTarget.setPlaceholderVisibility(txtvPlaceholder, textAndImageCombined, null);
        return;
    }
    RequestOptions options = new RequestOptions().diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY).fitCenter().dontAnimate();
    RequestBuilder<PaletteBitmap> builder = Glide.with(activity).as(PaletteBitmap.class).load(uri).apply(options);
    if (fallbackUri != null && txtvPlaceholder != null && imgvCover != null) {
        builder = builder.error(Glide.with(activity).as(PaletteBitmap.class).load(fallbackUri).apply(options));
    }
    builder.into(coverTarget);
}
Also used : RequestOptions(com.bumptech.glide.request.RequestOptions) PaletteBitmap(de.danoeh.antennapod.core.glide.PaletteBitmap)

Aggregations

RequestOptions (com.bumptech.glide.request.RequestOptions)1 PaletteBitmap (de.danoeh.antennapod.core.glide.PaletteBitmap)1