ScrollableDefaults


Contains the default values used by scrollable

Summary

Public functions

BringIntoViewSpec

A default implementation for BringIntoViewSpec that brings a child into view using the least amount of effort.

Cmn
FlingBehavior

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

Cmn
OverscrollEffect

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

Cmn
Boolean
reverseDirection(
    layoutDirection: LayoutDirection,
    orientation: Orientation,
    reverseScrolling: Boolean
)

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

Cmn

Public functions

bringIntoViewSpec

@ExperimentalFoundationApi
fun bringIntoViewSpec(): BringIntoViewSpec

A default implementation for BringIntoViewSpec that brings a child into view using the least amount of effort.

flingBehavior

@Composable
fun flingBehavior(): FlingBehavior

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

overscrollEffect

@Composable
@ExperimentalFoundationApi
fun overscrollEffect(): OverscrollEffect

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

reverseDirection

fun reverseDirection(
    layoutDirection: LayoutDirection,
    orientation: Orientation,
    reverseScrolling: Boolean
): Boolean

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

Parameters
layoutDirection: LayoutDirection

current layout direction (e.g. from LocalLayoutDirection)

orientation: Orientation

orientation of scroll

reverseScrolling: Boolean

whether scrolling direction should be reversed

Returns
Boolean

true if scroll direction should be reversed, false otherwise.