CarouselItemScope
@ExperimentalMaterial3Api
sealed interface CarouselItemScope
Receiver scope for Carousel
item content.
Properties
val carouselItemDrawInfo: CarouselItemDrawInfo
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.
Functions
@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 | the shape to be applied to the composable |
@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 | the border to be drawn around the composable |
shape | the shape of the border |
@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 | The shape that will be converted and remembered and react to changes in the item's mask. |