animateLazyGridItemEntrance

context(_: LazyGridItemScope)
fun Modifier.animateLazyGridItemEntrance(itemKey: Any, state: LazyGridItemEntranceState, repeatMode: LazyGridItemEntranceRepeatMode = LazyGridItemEntranceRepeatMode.OncePerKey, delay: LazyGridItemEntranceDelay = LazyGridItemEntranceDelay.diagonal(), animationSpec: FiniteAnimationSpec<Float> = tween(500, easing = LinearOutSlowInEasing), initialScale: Float = 0.8f, initialAlpha: Float = 0.0f): Modifier

Scales and fades a lazy grid item into place after its computed entrance delay.

The modifier waits until itemKey appears in state's visible item information, computes its delay from that layout snapshot, then animates scale and alpha to 1f. Delay, animation spec, initial scale, and initial alpha are captured when an animation run starts; updates to those parameters apply to the next run rather than altering one already in progress.

With LazyGridItemEntranceRepeatMode.OncePerKey, itemKey is recorded as soon as the run starts and before the computed delay. Cancellation or disposal after that point does not make the key eligible again; call LazyGridItemEntranceState.reset to do so explicitly.

Receiver

The modifier applied to an item of the lazy grid represented by state.

Return

This modifier followed by the lazy-grid entrance modifier.

Parameters

itemKey

The same stable and unique key supplied to the lazy grid item.

state

Coordinates visible-item lookup and remembers entered keys.

repeatMode

Determines whether the item animates on every composition or once per key.

delay

Computes how long the visible item waits before its transition begins. Negative computed durations are treated as Duration.ZERO.

animationSpec

The finite animation used for both scale and alpha progress.

initialScale

The scale on both axes at progress zero. It animates to 1f.

initialAlpha

The alpha at progress zero. It animates to 1f.