{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

LazyStaggeredGridItemScope

public sealed interface LazyStaggeredGridItemScope


Receiver scope for itemContent in LazyStaggeredGridScope.item

Summary

Public methods

abstract @NonNull Modifier

This modifier animates the item placement within the grid.

Public methods

animateItemPlacement

@ExperimentalFoundationApi
abstract @NonNull Modifier animateItemPlacement(
    @NonNull Modifier receiver,
    @NonNull FiniteAnimationSpec<@NonNull IntOffset> animationSpec
)

This modifier animates the item placement within the grid.

When you scroll backward staggered grids could move already visible items in order to correct the accumulated errors in previous item size estimations. This modifier can animate such moves.

Aside from that when you provide a key via LazyStaggeredGridScope.item / LazyStaggeredGridScope.items this modifier will enable item reordering animations.

Parameters
@NonNull FiniteAnimationSpec<@NonNull IntOffset> animationSpec

a finite animation that will be used to animate the item placement.