Package-level declarations

Types

Link copied to clipboard

Determines equality between two models.

Link copied to clipboard

A Painter that that executes an ImageRequest asynchronously and renders the ImageResult.

Link copied to clipboard

A SizeResolver that computes the size from the constraints passed during the layout phase or from setConstraints.

Link copied to clipboard

A special SizeResolver that waits until AsyncImagePainter.onDraw to return the DrawScope's size.

Link copied to clipboard
class ImagePainter(val image: Image) : Painter

Wraps an Image so it can be used as a Painter.

Link copied to clipboard

A scope for the children of SubcomposeAsyncImage.

Functions

Link copied to clipboard
expect fun Image.asPainter(context: PlatformContext, filterQuality: FilterQuality = DefaultFilterQuality): Painter

Convert this Image into a Painter using Compose primitives if possible.

actual fun Image.asPainter(context: PlatformContext, filterQuality: FilterQuality): Painter
Link copied to clipboard
fun AsyncImage(model: Any?, contentDescription: String?, imageLoader: ImageLoader, modifier: Modifier = Modifier, transform: (AsyncImagePainter.State) -> AsyncImagePainter.State = DefaultTransform, onState: (AsyncImagePainter.State) -> Unit? = null, alignment: Alignment = Alignment.Center, contentScale: ContentScale = ContentScale.Fit, alpha: Float = DefaultAlpha, colorFilter: ColorFilter? = null, filterQuality: FilterQuality = DefaultFilterQuality, clipToBounds: Boolean = true)
fun AsyncImage(model: Any?, contentDescription: String?, imageLoader: ImageLoader, modifier: Modifier = Modifier, placeholder: Painter? = null, error: Painter? = null, fallback: Painter? = error, onLoading: (AsyncImagePainter.State.Loading) -> Unit? = null, onSuccess: (AsyncImagePainter.State.Success) -> Unit? = null, onError: (AsyncImagePainter.State.Error) -> Unit? = null, alignment: Alignment = Alignment.Center, contentScale: ContentScale = ContentScale.Fit, alpha: Float = DefaultAlpha, colorFilter: ColorFilter? = null, filterQuality: FilterQuality = DefaultFilterQuality, clipToBounds: Boolean = true)

A composable that executes an ImageRequest asynchronously and renders the result.

Link copied to clipboard
inline fun AsyncImagePreviewHandler(crossinline image: suspend (request: ImageRequest) -> Image?): AsyncImagePreviewHandler

Convenience function that creates an AsyncImagePreviewHandler that returns an Image.

Link copied to clipboard
fun rememberAsyncImagePainter(model: Any?, imageLoader: ImageLoader, transform: (AsyncImagePainter.State) -> AsyncImagePainter.State = DefaultTransform, onState: (AsyncImagePainter.State) -> Unit? = null, contentScale: ContentScale = ContentScale.Fit, filterQuality: FilterQuality = DefaultFilterQuality): AsyncImagePainter
fun rememberAsyncImagePainter(model: Any?, imageLoader: ImageLoader, placeholder: Painter? = null, error: Painter? = null, fallback: Painter? = error, onLoading: (AsyncImagePainter.State.Loading) -> Unit? = null, onSuccess: (AsyncImagePainter.State.Success) -> Unit? = null, onError: (AsyncImagePainter.State.Error) -> Unit? = null, contentScale: ContentScale = ContentScale.Fit, filterQuality: FilterQuality = DefaultFilterQuality): AsyncImagePainter

Return an AsyncImagePainter that executes an ImageRequest asynchronously and renders the result.

Link copied to clipboard
fun SubcomposeAsyncImage(model: Any?, contentDescription: String?, imageLoader: ImageLoader, modifier: Modifier = Modifier, transform: (AsyncImagePainter.State) -> AsyncImagePainter.State = DefaultTransform, onState: (AsyncImagePainter.State) -> Unit? = null, alignment: Alignment = Alignment.Center, contentScale: ContentScale = ContentScale.Fit, alpha: Float = DefaultAlpha, colorFilter: ColorFilter? = null, filterQuality: FilterQuality = DefaultFilterQuality, clipToBounds: Boolean = true, content: @Composable SubcomposeAsyncImageScope.() -> Unit)
fun SubcomposeAsyncImage(model: Any?, contentDescription: String?, imageLoader: ImageLoader, modifier: Modifier = Modifier, transform: (AsyncImagePainter.State) -> AsyncImagePainter.State = DefaultTransform, loading: @Composable SubcomposeAsyncImageScope.(AsyncImagePainter.State.Loading) -> Unit? = null, success: @Composable SubcomposeAsyncImageScope.(AsyncImagePainter.State.Success) -> Unit? = null, error: @Composable SubcomposeAsyncImageScope.(AsyncImagePainter.State.Error) -> Unit? = null, onLoading: (AsyncImagePainter.State.Loading) -> Unit? = null, onSuccess: (AsyncImagePainter.State.Success) -> Unit? = null, onError: (AsyncImagePainter.State.Error) -> Unit? = null, alignment: Alignment = Alignment.Center, contentScale: ContentScale = ContentScale.Fit, alpha: Float = DefaultAlpha, colorFilter: ColorFilter? = null, filterQuality: FilterQuality = DefaultFilterQuality, clipToBounds: Boolean = true)

A composable that executes an ImageRequest asynchronously and renders the result.

Link copied to clipboard
fun SubcomposeAsyncImageScope.SubcomposeAsyncImageContent(modifier: Modifier = Modifier, painter: Painter = this.painter, contentDescription: String? = this.contentDescription, alignment: Alignment = this.alignment, contentScale: ContentScale = this.contentScale, alpha: Float = this.alpha, colorFilter: ColorFilter? = this.colorFilter, clipToBounds: Boolean = this.clipToBounds)

A composable that draws SubcomposeAsyncImage's content with SubcomposeAsyncImageScope's properties.