use of com.owncloud.android.utils.svg.SvgBitmapTranscoder in project android by nextcloud.
the class ActivityListAdapter method downloadIcon.
private void downloadIcon(Activity activity, ImageView itemViewType) {
GenericRequestBuilder<Uri, InputStream, SVG, Bitmap> requestBuilder = Glide.with(context).using(Glide.buildStreamModelLoader(Uri.class, context), InputStream.class).from(Uri.class).as(SVG.class).transcode(new SvgBitmapTranscoder(128, 128), Bitmap.class).sourceEncoder(new StreamEncoder()).cacheDecoder(new FileToStreamDecoder<>(new SvgDecoder())).decoder(new SvgDecoder()).placeholder(R.drawable.ic_activity).error(R.drawable.ic_activity).animate(android.R.anim.fade_in);
Uri uri = Uri.parse(activity.getIcon());
requestBuilder.diskCacheStrategy(DiskCacheStrategy.SOURCE).load(uri).into(itemViewType);
}
Aggregations