StreamImage

fun StreamImage(data: () -> Any?, modifier: Modifier = Modifier, component: ImageComponent = rememberImageComponent {}, requestListener: () -> ImageRequest.Listener? = null, imageOptions: ImageOptions = ImageOptions(), onImageStateChanged: (CoilImageState) -> Unit = {}, previewPlaceholder: Painter? = null, loading: @Composable BoxScope.(imageState: CoilImageState.Loading) -> Unit? = null, success: @Composable BoxScope.(imageState: CoilImageState.Success, painter: Painter) -> Unit? = null, failure: @Composable BoxScope.(imageState: CoilImageState.Failure) -> Unit? = null)

Wrapper around the CoilImage that plugs in our LocalStreamImageLoader singleton that can be used to customize all image loading requests, like adding headers, interceptors and similar.

Parameters

data

The data model to request image. See ImageRequest.Builder.data for types allowed.

modifier

Modifier used to adjust the layout or drawing content.

component

An image component that conjuncts pluggable ImagePlugins.

requestListener

A class for monitoring the status of a request while images load.

imageOptions

Represents parameters to load generic Image Composable.

onImageStateChanged

An image state change listener will be triggered whenever the image state is changed.

previewPlaceholder

A painter that is specifically rendered when this function operates in preview mode.

loading

Content to be displayed when the request is in progress.

success

Content to be displayed when the request is succeeded.

failure

Content to be displayed when the request is failed.


fun StreamImage(imageRequest: () -> ImageRequest, modifier: Modifier = Modifier, component: ImageComponent = rememberImageComponent {}, imageOptions: ImageOptions = ImageOptions(), onImageStateChanged: (CoilImageState) -> Unit = {}, previewPlaceholder: Painter? = null, loading: @Composable BoxScope.(imageState: CoilImageState.Loading) -> Unit? = null, success: @Composable BoxScope.(imageState: CoilImageState.Success, painter: Painter) -> Unit? = null, failure: @Composable BoxScope.(imageState: CoilImageState.Failure) -> Unit? = null)

Wrapper around the CoilImage that plugs in our LocalStreamImageLoader singleton that can be used to customize all image loading requests, like adding headers, interceptors and similar.

Parameters

model

The ImageRequest used to load the given image.

modifier

Modifier used to adjust the layout or drawing content.

component

An image component that conjuncts pluggable ImagePlugins.

imageOptions

Represents parameters to load generic Image Composable.

onImageStateChanged

An image state change listener will be triggered whenever the image state is changed.

previewPlaceholder

A painter that is specifically rendered when this function operates in preview mode.

loading

Content to be displayed when the request is in progress.

success

Content to be displayed when the request is succeeded.

failure

Content to be displayed when the request is failed.