glide
glide copied to clipboard
The same url but with different priority
trafficstars
Hi,
I need to preload a lot of images with different priorities. I'm doing it like this:
model.images.map { item ->
val target = GlideApp.with(contextProvider.get())
.load(imageMapper.map(model.settings, item.image))
.priority(item.priority.toGlidePriority())
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.preload()
target.request
}.let { requests -> requestsCache.addAll(requests) }
In the same time app could try to load the same image because it was requested from UI:
GlideApp.with(to.context)
.load(image.url)
.priority(Priority.IMMEDIATE)
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.set(Downsampler.ALLOW_HARDWARE_CONFIG, allowHardwareImages)
.into(to)
The question is what will be in this case with requests? Will UI request start other request or will it pick first?