Package-level declarations

Types

Link copied to clipboard
class ImageLruDiskCache(context: Context, cacheFolder: String, maxSizeBytes: Long = 10L * 1024 * 1024)

Implementation of disk cache based on DiskLruCache.

Link copied to clipboard
class ImageLruMemoryCache(val maxSize: Int = (Runtime.getRuntime().maxMemory() / 1024).toInt() / 8)

Implementation of in-memory cache based on LruCache.

Link copied to clipboard
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.

Functions

Link copied to clipboard

Given a local Uri created from resource, content or local file, try to create a Drawable from it.

Link copied to clipboard

Remembers Drawable wrapped up as a Painter. This function attempts to un-wrap the drawable contents and use Compose primitives where possible.

Link copied to clipboard
fun StripeImage(url: String, imageLoader: StripeImageLoader, contentDescription: String?, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit, colorFilter: ColorFilter? = null, debugPainter: Painter? = null, alignment: Alignment = Alignment.Center, disableAnimations: Boolean = false, errorContent: @Composable BoxWithConstraintsScope.() -> Unit = {}, loadingContent: @Composable BoxWithConstraintsScope.() -> Unit = {})

A composable that executes an image request asynchronously using the provided StripeImageLoader and renders the result.