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. |