Reputation: 612
I am using https://components.xamarin.com/view/KenBurnsView I have several image URL-s by which I want to show them via KenBurnsView
after setting src of KenBurnsView to the first imageURL, at the TransitionEnd I want to replace src with new image URL and restart animation, but I want the image to be preloaded to make everything smooth.
I would preload next image at the TransitionStart event so at the end image could be loaded, but I dont know how to do it.
Image caching is what I mean maybe but I dont know how to cache it very first time
Upvotes: 0
Views: 275
Reputation: 9356
For image caching you can do it yourself, saving the image in the FileSystem when downloaded from internet and next time you need to load the image you check if it's already local and if it's not you just hit the web and save it. There's of course a little more to do like deleting the images in file system after certain period but just wanted to give you the main idea.
For my projects I use this library FFImageLoading. It's well maintained and its use is so simple.
ImageService.Instance.LoadUrl(urlToImage).Into(_imageView);
When the image is loaded from internet the image is cached on disk (by default 30 days but there is an optional TimeSpan so you can choose yours).
Android documentation.
Upvotes: 2