bumptech/glide

pause and resume specific requests

Open

#2678 aperta il 4 dic 2017

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)Java (6176 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (35.023 star)
Metriche merge PR
 (Merge medio 4g 10h) (11 PR mergiate in 30 g)

Descrizione

Glide Version:4.3.1 Android Version:7.0

val glide = GlideApp.with(locationsFragment); adapter loading code var fullRequest = glide!! .asDrawable() .dontTransform() .override(size!!.x, size!!.y) fullRequest!!.load(imagePath) .error(GlideApp.with(locationsFragment).load(path) .into(holder.img)

I'm creating another request which is "thumbnail"

var thumbnailRequest = GlideApp.with(context) .asDrawable() .dontTransform() .priority(Priority.IMMEDIATE) .diskCacheStrategy(DiskCacheStrategy.DATA) .override(size!!.x / 100, size!!.y / 100)

Im using this to pause/resume requests glide.pauseRequests() glide.resumeRequests()

here glide is the same instance as above, which is used in fullrequest. thumbnailRequest uses another context and as I understand, another Glide instance.

I want some type of requests to be paused in Glide. But I tried and it pauses all requests. I have Recyclerview with items which have 2 different images. I want to pause requests for one type of images only. Is it possible?

Issue is that when I call glide.pauseRequests() , thumbnailRequest also gets paused.

Guida contributor