android-glide

How to make Picasso/Glide work with Html.ImageGetter for caching images?

泄露秘密 提交于 2020-01-13 14:00:28
问题 Thanks for all the effort @Budius has made. Most part of image work of my app could be handled by Picasso/Glide, however, some images are displayed in a TextView by Html.fromHtml . And the images in TextView are also used frequently. However, I don't know how to implement getDrawable() method with Picasso/Glide for the ImageGetter passed to Html.fromHtml . Is it possible to share the same cache of Picasso/Glide for these pictures in TextView and other bitmaps? Or should I use an custom

How to fix “canvas: trying to use a recycled bitmap error”?

拥有回忆 提交于 2020-01-11 08:37:07
问题 I'm creating a RecyclerView to show a Grid of pictures. When selecting one of them, it should open a new activity with a transition. I'm using Glide library to load the pictures and the transition looks awful because it reloads the picture in the new activity. So I had to save it in cache, and then use it for the transition. I have the code, but sometimes if the picture doesn't load, it throws a Canvas RuntimeException. This is the log: 07-03 15:19:58.633 28461-28461/jahirfiquitiva.project E

Glide - call method after fallback or error when trying load photo

天大地大妈咪最大 提交于 2020-01-11 05:59:05
问题 Glide - call method after fallback or error when trying load photo. Hi! Is there any a way to check if Glide load photo from link or use fallback / error when link isn't valid or photo isn't available? I mean, I want to call a method (load other photo) when Glide doesn't load photo. This is my Glide e.g.: Glide .with(mActivity) .load(news.getPagemap().getCseThumbnail().get(0).getSrc()) .fallback(R.drawable.bg_gradient) .error(R.drawable.bg_gradient) .centerCrop() .crossFade()

Crash on using Glide library

旧巷老猫 提交于 2020-01-06 06:42:47
问题 Loading different size of images into ImageView using Glide Library. But not sure why glide fails to handle the memory consumption, recycle and reuse it. Gradle: api 'com.github.bumptech.glide:glide:4.3.0' Usage: @BindingAdapter({"imageUrl"}) public static void imageUrl(ImageView view, String imageUrl) { try { if (imageUrl!=null) { Glide.with(view.getContext()).load(imageUrl).into(view); } } catch (Exception e) { e.printStackTrace(); } } Crash Log: 04-23 13:19:34.390 4758-4758/xx.xx.xxxE

Android Share Multiple Images with Other Apps

落爺英雄遲暮 提交于 2020-01-06 05:30:10
问题 I'm attempting to use the native Android share functionality to share a set of images I retrieved using Glide. So any app that is compatible with the images will show up in Android's share menu. I created a method that gets invoked when share is clicked. private void onShareClicked() { GlideUrl glideUrl = new GlideUrl(url1, new LazyHeaders.Builder().addHeader("x-auth-token", mToken).build()); FutureTarget<File> image1 = mGlide.load(glideUrl).downloadOnly(SIZE_ORIGINAL, SIZE_ORIGINAL);

Should I change all annotationProcessor to kapt in Kotlin project

浪子不回头ぞ 提交于 2020-01-05 06:36:07
问题 I noticed that I have to use kapt instead of annotationProcessor to make Dagger 2 work properly in my Kotlin project. Do I have to do the same to all the libraries (specifically Glide and Room )? 回答1: Yes, it is recommended to do so. The documentation stated: If you previously used the Android support for annotation processors, replace usages of the annotationProcessor configuration with kapt . If your project contains Java classes, kapt will also take care of them. Read more on Using kapt 来源

Should I change all annotationProcessor to kapt in Kotlin project

不羁的心 提交于 2020-01-05 06:35:33
问题 I noticed that I have to use kapt instead of annotationProcessor to make Dagger 2 work properly in my Kotlin project. Do I have to do the same to all the libraries (specifically Glide and Room )? 回答1: Yes, it is recommended to do so. The documentation stated: If you previously used the Android support for annotation processors, replace usages of the annotationProcessor configuration with kapt . If your project contains Java classes, kapt will also take care of them. Read more on Using kapt 来源

Glide - download and resize GIF into a file

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-05 05:42:26
问题 I need to download a GIF and save it to external storage so I can send it via MMS.Messages have a limit 300kb and most of the GIFs are too large so I need to resize them. I am using Glide in rest of my project and Glide has a nifty function which should, in theory, download a resized image. But it doesn't. In short, here's the code I'm calling inside a background thread: byte[] bytes = Glide.with(context) .load(url) .asGif() .toBytes() .into(250, 250) .get(); file = new File(fileName);

Load GIF From URL

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 05:59:30
问题 I tried to get this GIF from a URL like this: Glide.with(context) .load("http://artfcity.com/wp-content/uploads/2017/07/tumblr_osmx1ogeOD1r2geqjo1_540.gif") .into(new GlideDrawableImageViewTarget(imageViewBaby) { @Override public void onResourceReady(GlideDrawable drawable, GlideAnimation anim) { super.onResourceReady(drawable, anim); imageViewBaby.setImageDrawable(drawable); imageViewBaby.invalidate(); imageViewBaby.requestLayout(); } }); But the GIF will not move or start. It's just like an

Images disappear when scrolling up and down and spaces increase between images using Glide and RecyclerView

爷,独闯天下 提交于 2020-01-03 16:00:35
问题 I have a RecyclerView to display my images and I use Glide to load images from their URLs from my database in Firebase Storage. The problem is, when I scroll up and down, images reload and sometimes disappear and spaces between each image increase. How can I stop this? My RecyclerViewAdapter @Override public myViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View row = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_layout,parent,false); myViewHolder