Glide: Glide does not find images in drawable-night

Created on 24 Jul 2019  路  4Comments  路  Source: bumptech/glide

Hi

soon with Android Q the night mode will be very important in my opinion and it would be nice if you can fix this little problem. Glide does not find pictures in the following directories:

drawable-night
drawable-night-hdpi (also mdpi, xhdpi, xxhdpi and xxxhdpi)

Greets

Frank

stale

Most helpful comment

@frankyxcs Try using:

Glide.with(this)
            .load(ContextCompat.getDrawable(context, R.drawable.some_drawble))

instead of

Glide.with(this)
            .load(R.drawable.some_drawable)

All 4 comments

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

@frankyxcs Try using:

Glide.with(this)
            .load(ContextCompat.getDrawable(context, R.drawable.some_drawble))

instead of

Glide.with(this)
            .load(R.drawable.some_drawable)

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

I'm having the same problem. If I use michaelbukachi's workaround it works fine for me.

Also, if I explicitly setting a different key for my Drawable doesn't work.

boolean isNightModeEnabled = ...
String key = (isNightModeEnabled ? "night"  : "notnight") + drawableResourceId;
Glide.with(context).load(drawableResourceId).signature(new ObjectKey(key)).into(imageView);

Neither did explicitly setting the theme:

Glide.with(context).load(drawableResourceId).theme(context.getTheme()).into(imageView);
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sant527 picture sant527  路  3Comments

mttmllns picture mttmllns  路  3Comments

Tryking picture Tryking  路  3Comments

sergeyfitis picture sergeyfitis  路  3Comments

kenneth2008 picture kenneth2008  路  3Comments