-
public final class ImageUtilsKt
-
-
Method Summary
Modifier and Type Method Description final static ModifiermirrorRtl(Modifier $self, LayoutDirection layoutDirection)Applies the given mirroring scaleX based on the layoutDirection that's currently configured in the UI. final static UnitStreamImage(Function0<Object> data, Modifier modifier, ImageComponent component, Function0<ImageRequest.Listener> requestListener, ImageOptions imageOptions, Function1<CoilImageState, Unit> onImageStateChanged, Painter previewPlaceholder, Function2<BoxScope, CoilImageState.Loading, Unit> loading, Function3<BoxScope, CoilImageState.Success, Painter, Unit> success, Function2<BoxScope, CoilImageState.Failure, Unit> failure)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. final static UnitStreamImage(Function0<ImageRequest> imageRequest, Modifier modifier, ImageComponent component, ImageOptions imageOptions, Function1<CoilImageState, Unit> onImageStateChanged, Painter previewPlaceholder, Function2<BoxScope, CoilImageState.Loading, Unit> loading, Function3<BoxScope, CoilImageState.Success, Painter, Unit> success, Function2<BoxScope, CoilImageState.Failure, Unit> failure)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. final static AsyncImagePainterrememberStreamImagePainter(Object data, Painter placeholderPainter, Painter errorPainter, Painter fallbackPainter, Function1<AsyncImagePainter.State.Loading, Unit> onLoading, Function1<AsyncImagePainter.State.Success, Unit> onSuccess, Function1<AsyncImagePainter.State.Error, Unit> onError, ContentScale contentScale, FilterQuality filterQuality)Wrapper around the coil.compose. final static AsyncImagePainterrememberStreamImagePainter(ImageRequest model, Painter placeholderPainter, Painter errorPainter, Painter fallbackPainter, Function1<AsyncImagePainter.State.Loading, Unit> onLoading, Function1<AsyncImagePainter.State.Success, Unit> onSuccess, Function1<AsyncImagePainter.State.Error, Unit> onError, ContentScale contentScale, FilterQuality filterQuality)Wrapper around the coil.compose. -
-
Method Detail
-
mirrorRtl
final static Modifier mirrorRtl(Modifier $self, LayoutDirection layoutDirection)
Applies the given mirroring scaleX based on the layoutDirection that's currently configured in the UI.
Useful since the Painter from Compose doesn't know how to parse
autoMirroredflags in SVGs.
-
StreamImage
@Deprecated(message = Use Coil SubcomposeAsyncImage instead, replaceWith = @ReplaceWith(imports = {coil3.compose.SubcomposeAsyncImage}, expression = SubcomposeAsyncImage(model = data(), imageLoader = LocalStreamImageLoader.current)))@Composable() final static Unit StreamImage(Function0<Object> data, Modifier modifier, ImageComponent component, Function0<ImageRequest.Listener> requestListener, ImageOptions imageOptions, Function1<CoilImageState, Unit> onImageStateChanged, Painter previewPlaceholder, Function2<BoxScope, CoilImageState.Loading, Unit> loading, Function3<BoxScope, CoilImageState.Success, Painter, Unit> success, Function2<BoxScope, CoilImageState.Failure, Unit> failure)
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.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.
-
StreamImage
@Deprecated(message = Use Coil SubcomposeAsyncImage instead, replaceWith = @ReplaceWith(imports = {coil3.compose.SubcomposeAsyncImage}, expression = SubcomposeAsyncImage(model = imageRequest(), imageLoader = LocalStreamImageLoader.current)))@Composable() final static Unit StreamImage(Function0<ImageRequest> imageRequest, Modifier modifier, ImageComponent component, ImageOptions imageOptions, Function1<CoilImageState, Unit> onImageStateChanged, Painter previewPlaceholder, Function2<BoxScope, CoilImageState.Loading, Unit> loading, Function3<BoxScope, CoilImageState.Success, Painter, Unit> success, Function2<BoxScope, CoilImageState.Failure, Unit> failure)
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:
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.
-
rememberStreamImagePainter
@Deprecated(message = Use Coil rememberAsyncImagePainter instead, replaceWith = @ReplaceWith(imports = {coil3.compose.rememberAsyncImagePainter}, expression = rememberAsyncImagePainter(model = data, imageLoader = LocalStreamImageLoader.current)))@Composable() final static AsyncImagePainter rememberStreamImagePainter(Object data, Painter placeholderPainter, Painter errorPainter, Painter fallbackPainter, Function1<AsyncImagePainter.State.Loading, Unit> onLoading, Function1<AsyncImagePainter.State.Success, Unit> onSuccess, Function1<AsyncImagePainter.State.Error, Unit> onError, ContentScale contentScale, FilterQuality filterQuality)
Wrapper around the coil.compose.rememberAsyncImagePainter 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 to load as a painter.placeholderPainter- The painter used as a placeholder, while loading.errorPainter- The painter used when the request fails.fallbackPainter- The painter used as a fallback, in case the data is null.onLoading- Handler when the loading starts.onSuccess- Handler when the request is successful.onError- Handler when the request fails.contentScale- The scaling model to use for the image.filterQuality- The quality algorithm used when scaling the image.
-
rememberStreamImagePainter
@Deprecated(message = Use Coil rememberAsyncImagePainter instead, replaceWith = @ReplaceWith(imports = {coil3.compose.rememberAsyncImagePainter}, expression = rememberAsyncImagePainter(model = model, imageLoader = LocalStreamImageLoader.current)))@Composable() final static AsyncImagePainter rememberStreamImagePainter(ImageRequest model, Painter placeholderPainter, Painter errorPainter, Painter fallbackPainter, Function1<AsyncImagePainter.State.Loading, Unit> onLoading, Function1<AsyncImagePainter.State.Success, Unit> onSuccess, Function1<AsyncImagePainter.State.Error, Unit> onError, ContentScale contentScale, FilterQuality filterQuality)
Wrapper around the coil.compose.rememberAsyncImagePainter 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.placeholderPainter- The painter used as a placeholder, while loading.errorPainter- The painter used when the request fails.fallbackPainter- The painter used as a fallback, in case the data is null.onLoading- Handler when the loading starts.onSuccess- Handler when the request is successful.onError- Handler when the request fails.contentScale- The scaling model to use for the image.filterQuality- The quality algorithm used when scaling the image.
-
-
-
-