CarouselItemScope


Receiver scope for Carousel item content.

Summary

Public functions

Modifier

Draw a border on the composable using the given shape, taking into account the item's size in the cross axis and mask in the main axis.

Cmn
Modifier

Clips the composable to the given shape, taking into account the item's size in the cross axis and mask in the main axis.

Cmn
GenericShape

Converts and remembers shape into a GenericShape that uses the intersection of the carousel item's mask Rect and Size as the final shape's bounds.

Cmn

Public properties

CarouselItemDrawInfo

Information regarding the carousel item, such as its minimum and maximum size.

Cmn

Public functions

maskBorder

@Composable
fun Modifier.maskBorder(border: BorderStroke, shape: Shape): Modifier

Draw a border on the composable using the given shape, taking into account the item's size in the cross axis and mask in the main axis.

Parameters
border: BorderStroke

the border to be drawn around the composable

shape: Shape

the shape of the border

maskClip

@Composable
fun Modifier.maskClip(shape: Shape): Modifier

Clips the composable to the given shape, taking into account the item's size in the cross axis and mask in the main axis.

Parameters
shape: Shape

the shape to be applied to the composable

rememberMaskShape

@Composable
fun rememberMaskShape(shape: Shape): GenericShape

Converts and remembers shape into a GenericShape that uses the intersection of the carousel item's mask Rect and Size as the final shape's bounds.

This method is useful if using a Shape in a Modifier other than maskClip and maskBorder where the shape should follow the changes in the item's mask size.

Parameters
shape: Shape

The shape that will be converted and remembered and react to changes in the item's mask.

Public properties

carouselItemDrawInfo

val carouselItemDrawInfoCarouselItemDrawInfo

Information regarding the carousel item, such as its minimum and maximum size.

The item information is updated after every scroll. If you use it in a composable function, it will be recomposed on every change causing potential performance issues. Avoid using it in the composition.