SubcomposeAsyncImage
A composable that executes an ImageRequest asynchronously and renders the result.
NOTE: This API uses subcomposition, which is slow. Avoid using this composable in places that need high performance (e.g. LazyRow
/LazyColumn
).
Parameters
Either an ImageRequest or the ImageRequest.data value.
Text used by accessibility services to describe what this image represents. This should always be provided unless this image is used for decorative purposes, and does not represent a meaningful action that a user can take.
The ImageLoader that will be used to execute the request.
Modifier used to adjust the layout algorithm or draw decoration content.
An optional callback to overwrite what's drawn while the image request is loading.
An optional callback to overwrite what's drawn when the image request succeeds.
An optional callback to overwrite what's drawn when the image request fails.
Called when the image request begins loading.
Called when the image request completes successfully.
Called when the image request completes unsuccessfully.
Optional alignment parameter used to place the AsyncImagePainter in the given bounds defined by the width and height.
Optional scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size of the AsyncImagePainter.
Optional opacity to be applied to the AsyncImagePainter when it is rendered onscreen.
Optional ColorFilter to apply for the AsyncImagePainter when it is rendered onscreen.
Sampling algorithm applied to a bitmap when it is scaled and drawn into the destination.
If true, clips the content to its bounds. Else, it will not be clipped.
A composable that executes an ImageRequest asynchronously and renders the result.
NOTE: This API uses subcomposition, which is slow. Avoid using this composable in places that need high performance (e.g. LazyRow
/LazyColumn
).
Parameters
Either an ImageRequest or the ImageRequest.data value.
Text used by accessibility services to describe what this image represents. This should always be provided unless this image is used for decorative purposes, and does not represent a meaningful action that a user can take.
The ImageLoader that will be used to execute the request.
Modifier used to adjust the layout algorithm or draw decoration content.
A callback to transform a new State before it's applied to the AsyncImagePainter. Typically this is used to modify the state's Painter.
Called when the state of this painter changes.
Optional alignment parameter used to place the AsyncImagePainter in the given bounds defined by the width and height.
Optional scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size of the AsyncImagePainter.
Optional opacity to be applied to the AsyncImagePainter when it is rendered onscreen.
Optional ColorFilter to apply for the AsyncImagePainter when it is rendered onscreen.
Sampling algorithm applied to a bitmap when it is scaled and drawn into the destination.
If true, clips the content to its bounds. Else, it will not be clipped.
A callback to draw the content inside a SubcomposeAsyncImageScope.