TransformingLazyColumnItemScope

Interface
Android
@TransformingLazyColumnScopeMarker
public sealed interface TransformingLazyColumnItemScope

Receiver scope being used by the item content parameter of TransformingLazyColumn.

Functions

public fun Modifier.transformedHeight(
        heightProvider:
            (measuredHeight: Int, scrollProgress: TransformingLazyColumnItemScrollProgress) -> Int
    ): Modifier

Applies the new height of the item depending on its scroll progress and measured height.

Parameters

heightProvider The transformation to be applied. The first parameter is the height of the item returned during measurement. The second parameter is the scroll progress of the item. This lambda should not read from any state values.
public fun Modifier.animateItem(
        fadeInSpec: FiniteAnimationSpec<Float>? = spring(stiffness = Spring.StiffnessMediumLow),
        placementSpec: FiniteAnimationSpec<IntOffset>? =
            spring(
                stiffness = Spring.StiffnessMediumLow,
                visibilityThreshold = IntOffset.VisibilityThreshold,
            ),
        fadeOutSpec: FiniteAnimationSpec<Float>? = spring(stiffness = Spring.StiffnessMediumLow),
    ): Modifier

This modifier animates item appearance (fade in), disappearance (fade out) and placement changes (such as an item reordering).

You should also provide a unique key via TransformingLazyColumnScope.item/ TransformingLazyColumnScope.items for this modifier to enable animations.

Parameters

fadeInSpec an animation spec to use for animating the item appearance. When null is provided the item will appear without animations.
placementSpec an animation spec that will be used to animate the item placement. Aside from item reordering all other position changes caused by events like arrangement or alignment changes will also be animated. When null is provided no animations will happen.
fadeOutSpec an animation spec to use for animating the item disappearance. When null is provided the item will be disappearance without animations.
public fun Modifier.minimumVerticalContentPadding(top: Dp, bottom: Dp): Modifier

This modifier allows items to choose a preferred content padding for the list, if they are placed at the top or bottom edge. When this item is at the top or bottom of the layout, the TransformingLazyColumn takes its contentPadding as the maximum of these vertical padding values and its own contentPadding parameter.

The vertical padding values are expected to be provided by design systems, such as the recommended values in Material3 ButtonDefaults, CardDefaults, ListHeaderDefaults and so on.

This modifier can be used to ensure that, when a list item is at the top or bottom of the list, the distance from the item to the screen edge is sufficient (such as to avoid the item being clipped by edges of a round screen).

Parameters

top The preferred top content padding for the list, when this item is placed at the top edge. Used when either this is the first item for a layout that is not reversed, or this is the last item for a reversed layout.
bottom The preferred bottom content padding for the list, when this item is placed at the bottom edge. Used when either this is the last item for a layout that is not reversed, or this is the first item for a reversed layout.
public fun Modifier.minimumVerticalContentPadding(padding: Dp): Modifier

This modifier allows items to choose a preferred content padding for the list, if they are placed at the top or bottom edge. When this item is at the top or bottom of the layout, the TransformingLazyColumn takes its contentPadding as the maximum of this vertical padding value and its own contentPadding parameter.

The vertical padding values are expected to be provided by design systems, such as the recommended values in Material3 ButtonDefaults, CardDefaults, ListHeaderDefaults and so on.

This modifier can be used to ensure that, when a list item is at the top or bottom of the list, the distance from the item to the screen edge is sufficient (such as to avoid the item being clipped by edges of a round screen).

Parameters

padding The preferred content padding for the list, when this item is placed at either the top or bottom edges.