StripeImageLoader

class StripeImageLoader(context: Context, logger: Logger = Logger.getInstance(context.isDebuggable()), memoryCache: ImageLruMemoryCache? = ImageLruMemoryCache(), networkImageDecoder: NetworkImageDecoder = NetworkImageDecoder(), diskCache: ImageLruDiskCache? = ImageLruDiskCache( context = context, cacheFolder = "stripe_image_cache" ))

Image loader that fetches images from memory, disk or network and runs cache policy accordingly.

StripeImageLoader is stateful as it holds the memoryCache instance. For memory cache to work the image loader instance needs to be shared.

Parameters

memoryCache

, memory cache to be used, or null if no memory cache is desired.

diskCache

, memory cache to be used, or null if no memory cache is desired.

Constructors

Link copied to clipboard
constructor(context: Context, logger: Logger = Logger.getInstance(context.isDebuggable()), memoryCache: ImageLruMemoryCache? = ImageLruMemoryCache(), networkImageDecoder: NetworkImageDecoder = NetworkImageDecoder(), diskCache: ImageLruDiskCache? = ImageLruDiskCache( context = context, cacheFolder = "stripe_image_cache" ))

Functions

Link copied to clipboard
suspend fun load(url: String): Result<Bitmap?>

suspend fun load(url: String, width: Int, height: Int): Result<Bitmap?>

loads the given url with the associated widthxheight.