FFImageLoading icon indicating copy to clipboard operation
FFImageLoading copied to clipboard

Image Download Priority

Open joeforshaw opened this issue 10 years ago • 5 comments

Hi there,

I have a view which contains a bunch of images, some on-screen, some off-screen accessible by scrolling through carousels. When images are being downloaded, I want to be able to prioritise the on-screen images and download those first, then the off-screen images.

Therefore I'd like to request some download priority system be implemented which allows me to accomplish such a goal. Apologies if this already exists and I've missed it in your docs.

Cheers.

joeforshaw avatar Mar 02 '16 16:03 joeforshaw

It would not be that hard to add such a prioritization system, we could add new Fluent method WithPriority() which would accept an enum:

LoadingPriority
{
   Lowest = -1
   Low = -2,
   Normal = 0,
   High = 1,
   Highest = 2
}

By default all request would have priority Normal @daniel-luberda @joeforshaw What do you think about it?

molinch avatar Mar 02 '16 16:03 molinch

Would it be possible to pass the priority as an int instead of an enum? That way you have very fine grain control of the priority an image.

joeforshaw avatar Mar 02 '16 16:03 joeforshaw

Yes, we should definitely implement it. I already mentioned about it here: https://github.com/molinch/FFImageLoading/issues/143#issuecomment-185732777 - it would be also very useful in that case.

+1 for WithPriority() fluent method and LoadingPriority enum. We could also implement a method with int param but it should be optional as it can be misleading (for advanced use only). Maybe something like:

LoadingPriority
{
   Lowest = -100,
   Low = -50,
   Normal = 0,
   High = 50,
   Highest = 100
}

daniel-luberda avatar Mar 02 '16 17:03 daniel-luberda

Perfect.

joeforshaw avatar Mar 02 '16 17:03 joeforshaw

There is now an Alpha nuget that includes it: https://www.nuget.org/packages/Xamarin.FFImageLoading.Forms/2.1.0-alpha1

Please note that this is NOT production ready but it allows to test the functionality. Could you give us your feedback on it?

molinch avatar Mar 09 '16 17:03 molinch