bumptech / bumptech/glide

Placeholder cache with values and values-night resources

Open
#3,751 7 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**: 4.8.0
**Integration libraries**: OkHttp -> 3.9.1
**Device/Android Version**: Galaxy S8 | Android 9.0 Pie

**Issue details / Repro steps / Use case background**:

I'm working on a Day/Night application and I have two different placeholders for each mode.

(To understand how values and values-night works, see this : https://medium.com/androiddevelopers/appcompat-v23-2-daynight-d10f90c83e94)

To simplify, I'm using the same resource with two background color :

**placeholder.xml**
`


`

**values/colors.xml**
`@color/white`

**values-night/colors.xml**
`@color/black`

**Glide request**
`.....
new GlideOptions()
.placeholder(R.drawable.placeholder)
.error(R.drawable.placeholder)
.transform(transformation)
......`

My issue here is when the user is in the day mode, a white placeholder will be loaded and displayed, but if the user change to night mode, the placeholder will stay in cache and won't change to the night version of the placeholder.

I know there is a glide cache for images but I don't know how to clear the placeholder cache.

If you have any idea to clear this resource and display the right one.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.