use of com.owncloud.android.utils.svg.SvgDrawableTranscoder in project android by nextcloud.
the class DisplayUtils method downloadSVGIcon.
private static void downloadSVGIcon(Context context, String iconUrl, SimpleTarget imageView, int placeholder, int width, int height) {
GenericRequestBuilder<Uri, InputStream, SVG, PictureDrawable> requestBuilder = Glide.with(context).using(Glide.buildStreamModelLoader(Uri.class, context), InputStream.class).from(Uri.class).as(SVG.class).transcode(new SvgDrawableTranscoder(), PictureDrawable.class).sourceEncoder(new StreamEncoder()).cacheDecoder(new FileToStreamDecoder<>(new SvgDecoder(height, width))).decoder(new SvgDecoder(height, width)).placeholder(placeholder).error(placeholder).animate(android.R.anim.fade_in);
Uri uri = Uri.parse(iconUrl);
requestBuilder.diskCacheStrategy(DiskCacheStrategy.SOURCE).load(uri).into(imageView);
}
use of com.owncloud.android.utils.svg.SvgDrawableTranscoder in project android by nextcloud.
the class NotificationListAdapter method downloadIcon.
private void downloadIcon(String icon, ImageView itemViewType) {
GenericRequestBuilder<Uri, InputStream, SVG, PictureDrawable> requestBuilder = Glide.with(notificationsActivity).using(Glide.buildStreamModelLoader(Uri.class, notificationsActivity), InputStream.class).from(Uri.class).as(SVG.class).transcode(new SvgDrawableTranscoder(), PictureDrawable.class).sourceEncoder(new StreamEncoder()).cacheDecoder(new FileToStreamDecoder<>(new SvgDecoder())).decoder(new SvgDecoder()).placeholder(R.drawable.ic_notification).error(R.drawable.ic_notification).animate(android.R.anim.fade_in).listener(new SvgSoftwareLayerSetter<>());
Uri uri = Uri.parse(icon);
requestBuilder.diskCacheStrategy(DiskCacheStrategy.SOURCE).load(uri).into(itemViewType);
}
use of com.owncloud.android.utils.svg.SvgDrawableTranscoder in project android by nextcloud.
the class ActivityListAdapter method downloadIcon.
private void downloadIcon(String icon, ImageView itemViewType) {
GenericRequestBuilder<Uri, InputStream, SVG, PictureDrawable> requestBuilder = Glide.with(context).using(Glide.buildStreamModelLoader(Uri.class, context), InputStream.class).from(Uri.class).as(SVG.class).transcode(new SvgDrawableTranscoder(), PictureDrawable.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).listener(new SvgSoftwareLayerSetter<>());
Uri uri = Uri.parse(icon);
requestBuilder.diskCacheStrategy(DiskCacheStrategy.SOURCE).load(uri).into(itemViewType);
}
use of com.owncloud.android.utils.svg.SvgDrawableTranscoder in project android by nextcloud.
the class DisplayUtils method downloadSVGIcon.
private static void downloadSVGIcon(CurrentAccountProvider currentAccountProvider, ClientFactory clientFactory, Context context, String iconUrl, SimpleTarget imageView, int placeholder, int width, int height) {
GenericRequestBuilder<Uri, InputStream, SVG, PictureDrawable> requestBuilder = Glide.with(context).using(new CustomGlideUriLoader(currentAccountProvider.getUser(), clientFactory), InputStream.class).from(Uri.class).as(SVG.class).transcode(new SvgDrawableTranscoder(), PictureDrawable.class).sourceEncoder(new StreamEncoder()).cacheDecoder(new FileToStreamDecoder<>(new SvgDecoder(height, width))).decoder(new SvgDecoder(height, width)).placeholder(placeholder).error(placeholder).animate(android.R.anim.fade_in);
Uri uri = Uri.parse(iconUrl);
requestBuilder.diskCacheStrategy(DiskCacheStrategy.SOURCE).load(uri).into(imageView);
}
Aggregations