ListFocusSnapFlingBehaviorKt
public final class ListFocusSnapFlingBehaviorKt
Summary
Public methods |
|
|---|---|
static final @NonNull SnapLayoutInfoProvider |
SnapLayoutInfoProvider(@NonNull ListState state)List snapping aligns the focus line with the center of the closest item. |
static final @NonNull FlingBehavior |
Creates and remembers a focus-aware fling behavior that aligns the focus line with the center of the element expected to gain focus at the end of the fling. |
Public methods
SnapLayoutInfoProvider
public static final @NonNull SnapLayoutInfoProvider SnapLayoutInfoProvider(@NonNull ListState state)
List snapping aligns the focus line with the center of the closest item. Combined with adaptive scrolling, this ensures that users have to move the same distance when swipes between items of the similar size, resulting in predictable movement.
| Returns | |
|---|---|
@NonNull SnapLayoutInfoProvider |
A focus-aware |
rememberSnapFlingBehavior
@Composable
public static final @NonNull FlingBehavior rememberSnapFlingBehavior(@NonNull ListState state)
Creates and remembers a focus-aware fling behavior that aligns the focus line with the center of the element expected to gain focus at the end of the fling. This ensures predictable movement for users.
| Returns | |
|---|---|
@NonNull FlingBehavior |
A |