Glide.with(context)
.load(R.drawable.image)
.error(R.drawable.default_image)
.placeholder(R.drawable.default_image)
.diskCacheStrategy(DiskCacheStrategy.RESULT)
.into(imageView);
--
You received this message because you are subscribed to the Google Groups "Glide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glidelibrary+unsubscribe@googlegroups.com.
To post to this group, send email to glidel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glidelibrary/3e162c4a-d37f-47f7-b02e-8746cf85319b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Glide doesn't support Drawable types other than simple BitmapDrawables. If you're interested in adding support, I'd be willing to look at PR. In general there's not a lot of value to using Glide to load standard resources.Sam
On Sun, Feb 26, 2017 at 10:52 PM, <gjdyo...@126.com> wrote:
I try to use StateListDrawable R.drawable.image in Glide, but it always show the error R.drawable.default_image. However, if replace R.drawable.image with R.drawable.image_add_sel, it will show normally. I use it as below:Glide.with(context) .load(R.drawable.image) .error(R.drawable.default_image) .placeholder(R.drawable.default_image) .diskCacheStrategy(DiskCacheStrategy.RESULT) .into(imageView);
I find the root cause is :in com.bumptech.glide.load.data.FileDescriptorLocalUriFetcher.java@Overrideprotected ParcelFileDescriptor loadResource(Uri uri, ContentResolver contentResolver) throws FileNotFoundException {return contentResolver.openAssetFileDescriptor(uri, "r").getParcelFileDescriptor();}It will throw "This file can not be opened as a file descriptor; it is probably compressed" exception, it not support StateListDrawable resource.I think it's common to use StateListDrawable in ImageView, so could this issue be fixed? Thanks.
--
You received this message because you are subscribed to the Google Groups "Glide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glidelibrary...@googlegroups.com.