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

ScrollableDefaults

public static class ScrollableDefaults


Contains the default values used by scrollable

Summary

Public fields

static @NonNull ScrollableDefaults

Public methods

final @NonNull FlingBehavior

Create and remember default FlingBehavior that will represent natural fling curve.

final @NonNull OverscrollEffect

Create and remember default OverscrollEffect that will be used for showing over scroll effects.

final boolean
reverseDirection(
    @NonNull LayoutDirection layoutDirection,
    @NonNull Orientation orientation,
    boolean reverseScrolling
)

Used to determine the value of reverseDirection parameter of Modifier.scrollable in scrollable layouts.

Public fields

INSTANCE

public static @NonNull ScrollableDefaults INSTANCE

Public methods

flingBehavior

@Composable
public final @NonNull FlingBehavior flingBehavior()

Create and remember default FlingBehavior that will represent natural fling curve.

overscrollEffect

@Composable
@ExperimentalFoundationApi
public final @NonNull OverscrollEffect overscrollEffect()

Create and remember default OverscrollEffect that will be used for showing over scroll effects.

reverseDirection

public final boolean reverseDirection(
    @NonNull LayoutDirection layoutDirection,
    @NonNull Orientation orientation,
    boolean reverseScrolling
)

Used to determine the value of reverseDirection parameter of Modifier.scrollable in scrollable layouts.

Parameters
@NonNull LayoutDirection layoutDirection

current layout direction (e.g. from LocalLayoutDirection)

@NonNull Orientation orientation

orientation of scroll

boolean reverseScrolling

whether scrolling direction should be reversed

Returns
boolean

true if scroll direction should be reversed, false otherwise.