Issue 1:
Glide Version: com.github.bumptech.glide:glide:4.2.0

Integration libraries: No

Device/Android Version: Samsung

What happened

I want to load gif images that stored locally. I get the drawable based on the name of the file. when try to load with glide it's crash with the logcat below.

If i access to the file with R.drawable.anygif then it's working fine.

With GlideApp.load(getDrawable(mContext, "filename")), In the logcat it says Failed to find any ModelLoaders for model BitmapDrawable, but BitmapDrawable is a subclass of Drawable then it would be better if this can be load as well.

With GlideApp.load(getDrawable(mContext, "filename")), If i use it in placeholder then gif not working ( just an image ).

Any idea?

Glide load line / GlideModule (if any) / list Adapter code (if any):

Working

GlideApp.with(mContext)
.load(R.drawable.anygif)
.override(320)
.diskCacheStrategy(DiskCacheStrategy.DATA)
.placeholder(R.mipmap.placeholder)
.into(fakePageVH.mImgSticker);

Not Working

GlideApp.with(mContext)
.load(getDrawable(mContext, "filename"))
.override(320)
.diskCacheStrategy(DiskCacheStrategy.DATA)
.placeholder(R.mipmap.ic_launcher_round)
.into(fakePageVH.mImgSticker);

Working but gif not play, just an image

GlideApp.with(mContext)
.load("")
.override(320)
.diskCacheStrategy(DiskCacheStrategy.DATA)
.placeholder(getDrawable(mContext, "filename"))
.into(fakePageVH.mImgSticker);

Helper

public static Drawable getDrawable(Context context, String ImageName) {
return ContextCompat.getDrawable(context, context.getResources().getIdentifier(ImageName, "drawable", context.getPackageName()));
}

Stack trace / LogCat:

com.bumptech.glide.Registry$NoModelLoaderAvailableException: Failed to find any ModelLoaders for model: android.graphics.drawable.BitmapDrawable@ad5185c
at com.bumptech.glide.Registry.getModelLoaders(Registry.java:543)
at com.bumptech.glide.load.engine.DecodeHelper.getLoadData(DecodeHelper.java:186)
at com.bumptech.glide.load.engine.DecodeHelper.getCacheKeys(DecodeHelper.java:204)
at com.bumptech.glide.load.engine.DataCacheGenerator.<init>(DataCacheGenerator.java:33)
at com.bumptech.glide.load.engine.DecodeJob.getNextGenerator(DecodeJob.java:278)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:259)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:386)

Issue 2:
Idea

Glide.with(this).load(bitmap).into(imageView);
Glide.with(this).load(drawable).into(imageView);

This looks weird compared to ImageView.setImageBitmap(bitmap), but if you need animation and error handling (null bitmap), the above could become an easy to use, fire and forget, go-to line instead of duplicating code.

Note: you've already made a wrapper of ImageView#setImageResource and ImageView#setImageUri.

Currently they throw

Caused by: java.lang.IllegalArgumentException: Unknown type android.graphics.Bitmap@44759ab8. You must provide a Model of a type for which there is a registered ModelLoader, if you are using a custom model, you must first call Glide#register with a ModelLoaderFactory for your custom model class.

at com.bumptech.glide.RequestManager.loadGeneric(RequestManager.java:382)

at com.bumptech.glide.RequestManager.load(RequestManager.java:374)

Context

This came up when I was trying to display a captured image using Glide (oversimplified code):

startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), Activity.RESULT_FIRST_USER);

public void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == REQUEST_CODE_GET_PICTURE && resultCode == Activity.RESULT_OK) {
Bitmap bitmap = (Bitmap)data.getExtras().get("data");
Glide.with(this).load(bitmap)/*...*/.into(image);