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

LazyListSnapLayoutInfoProviderKt

public final class LazyListSnapLayoutInfoProviderKt


Summary

Public methods

static final @NonNull SnapLayoutInfoProvider

A SnapLayoutInfoProvider for LazyLists.

static final @NonNull FlingBehavior

Create and remember a FlingBehavior for decayed snapping in Lazy Lists.

Public methods

SnapLayoutInfoProvider

@ExperimentalFoundationApi
public static final @NonNull SnapLayoutInfoProvider SnapLayoutInfoProvider(
    @NonNull LazyListState lazyListState,
    @NonNull SnapPositionInLayout positionInLayout
)

A SnapLayoutInfoProvider for LazyLists.

Parameters
@NonNull LazyListState lazyListState

The LazyListState with information about the current state of the list

@NonNull SnapPositionInLayout positionInLayout

The desired positioning of the snapped item within the main layout. This position should be considered with regard to the start edge of the item and the placement within the viewport.

rememberSnapFlingBehavior

@ExperimentalFoundationApi
@Composable
public static final @NonNull FlingBehavior rememberSnapFlingBehavior(@NonNull LazyListState lazyListState)

Create and remember a FlingBehavior for decayed snapping in Lazy Lists. This will snap the item's center to the center of the viewport.

Parameters
@NonNull LazyListState lazyListState

The LazyListState from the LazyList where this FlingBehavior will be used.