Image Loader
Hi everyone,
Today I present a new extension based on Universal Image Loader that allows you to load and cache images.
Demo
Event
- OnLoadingStarted: Event when the loading of the image is started. The url returns the URL of the image.
- OnLoadingFailed: Event when the image is failed to load. The url returns the URL of the image.
- OnLoadingComplete: Event when the image is loaded. The url returns the URL of the image.
- OnProgress: Event when the image is loading. The url returns the URL of the image, current returns the current size of the image in bytes, total returns the total size in bytes of the image that is loading.
Methods
- LoadImage: This method loads the image in the image component. Parameters : imageComponent: The image component where the image will be displayed. url: The URL of the image you want to load.
- LoadImageInArrangement: This method loads the image in the vertical/horizontal arrangement component. Parameters : hvArrangement: The vertical/horizontal arrangement component where the image will be displayed. url: The URL of the image you want to load.
- LoadImageAsync: This method loads the image Asynchronous in the image component. Parameters : imageComponent: The image component where the image will be displayed. url: The URL of the image you want to load.
- LoadImageAsyncInArrangement: This method loads the image Asynchronous in the vertical/horizontal arrangement component. Parameters : hvArrangement: The vertical/horizontal arrangement component where the image will be displayed. url: The URL of the image you want to load.
- CacheImage: This method cache the image without display it. Parameters : url: The URL of the image you want to cache.
-
CachedImageExists: This method return
true
if the image is in the cache, andfalse
if the image is not in cache. Parameters : url: The URL of the image you want to check.
- DeleteCachedImage: This method delete image from the cache. Parameters : url: The URL of the image you want to delete from the cache.
ExtractCachedImage: This method extracts/copy the image from the cache and save it in a directory that you want. Parameters : url: The URL of the image you want to extract. saveIn: The directory where the image will be saved. extension: The extension of the image (for example:
.png
.jpg
).
Note: This method works only ifWRITE_EXTERNAL_STORAGE
is granted before loading/caching the image, see the example below.
ExtractCachedImage Usage
- ClearDiskCache: This method clean the Disk Cache.
- ClearMemoryCache: This method clean the Memory Cache.
- PauseLoading: All images that are loading will be paused.
- ResumeLoading: All images that are paused will be resumed.
- StopLoading: All images that are loading will be stopped.
Properties
- DisableCacheOnDisk: If it is checked, it won’t cache on disk.
- DisableCacheInMemory: If it is checked, it won’t cache in memory.
- LoadingImage: The image that will be displayed when is loading.
- ErrorImage: The image that will be displayed when in case of an error.
Source code
Downloads
Aix: com.devyb.devybimageloader.aix (216.1 KB)
Aia: ImageLoader.aia (217.2 KB)
Apk: ImageLoader.apk (5.2 MB)
Latest Version: 6
Released:2020-06-21T22:00:00Z
Last Updated:2020-10-02T22:00:00Z
I hope you like this extension, and I hope it helps many users in our community to develop high-quality apps.
If you liked this extension and you think it will be useful for the community, let me know with a .