UnstyledDraggableAnchors

Structure that represents the anchors of a UnstyledAnchoredDraggableState.

See the DraggableAnchors factory method to construct drag anchors using a default implementation.

Properties

Link copied to clipboard
abstract val size: Int

The amount of anchors

Functions

Link copied to clipboard
abstract fun closestAnchor(position: Float): T?

Find the closest anchor to the position.

abstract fun closestAnchor(position: Float, searchUpwards: Boolean): T?

Find the closest anchor to the position, in the specified direction.

Link copied to clipboard
abstract fun forEach(block: (anchor: T, position: Float) -> Unit)

Iterate over all the anchors and corresponding positions.

Link copied to clipboard
abstract fun hasAnchorFor(value: T): Boolean

Whether there is an anchor position associated with the value

Link copied to clipboard
abstract fun maxAnchor(): Float

The biggest anchor, or Float.POSITIVE_INFINITY if the anchors are empty.

Link copied to clipboard
abstract fun minAnchor(): Float

The smallest anchor, or Float.NEGATIVE_INFINITY if the anchors are empty.

Link copied to clipboard
abstract fun positionOf(value: T): Float

Get the anchor position for an associated value