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
class CrossfadePainter(start: Painter?, val end: Painter?, val contentScale: ContentScale = ContentScale.Fit, val duration: Duration = 200.milliseconds, val timeSource: TimeSource = TimeSource.Monotonic, val fadeStart: Boolean = true, val preferExactIntrinsicSize: Boolean = false, val preferEndFirstIntrinsicSize: Boolean = false) : Painter

A Painter that crossfades from start to end.

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.

Properties

Functions

Link copied to clipboard
actual fun Image.asPainter(context: PlatformContext, filterQuality: FilterQuality): Painter
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
@JvmName(name = "AsyncImagePreviewHandlerNotNull")
inline fun AsyncImagePreviewHandler(crossinline image: suspend (request: ImageRequest) -> Image): AsyncImagePreviewHandler

Convenience function that creates an AsyncImagePreviewHandler that returns an Image.

Link copied to clipboard

Returns true if this request prefers the end painter's intrinsic size when calculating the CrossfadePainter's intrinsic size.

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.

Link copied to clipboard

If enabled and the image request has no placeholder, the current image displayed by the AsyncImagePainter/AsyncImage/SubcomposeAsyncImage will be used as the placeholder for this image request. If disabled (the default), the image request's placeholder is always used as the placeholder even if it is null.