Package-level declarations

Types

Link copied to clipboard

anchored draggable 选择目标 anchor 的原因。 Reason why anchored draggable selected a target anchor.

Link copied to clipboard
data class AnchoredSettleResult(val targetOffsetPx: Float, val reason: AnchoredSettleReason)

anchored draggable 结束时解析出的目标位置。 Target position resolved when anchored draggable settles.

Link copied to clipboard
data class AnchoredThresholdPolicy(val slopMultiplier: Float = 2.0f, val segmentFraction: Float = 0.35f, val minFlingVelocityOverridePxPerSecond: Float? = null)

anchored draggable 的距离和速度阈值策略。 Distance and velocity threshold policy for anchored draggable.

Link copied to clipboard

指针移动超过 slop 后锁定的主轴。 Primary axis locked after pointer movement crosses touch slop.

Link copied to clipboard
sealed interface SwipeDecision

拖拽结束后 renderer 应执行的 swipe/settle 决策。 Swipe or settle decision a renderer should perform after drag end.

Link copied to clipboard

swipe 判定时使用的轴向。 Axis used when resolving a swipe decision.

Link copied to clipboard

未形成 swipe 时应收敛到的端点。 Endpoint to settle to when the drag does not become a swipe.

Functions

Link copied to clipboard

校验 anchor 像素列表必须非空、有限且严格递增。 Validates that anchor pixel offsets are non-empty, finite, and strictly increasing.

Link copied to clipboard
fun resolveAnchoredOffsetOnAnchorUpdate(anchorsPx: List<Float>, currentValueOffsetPx: Float?, currentOffsetPx: Float?): Float

anchor 集合变化时,选择应保留的当前 offset。 Chooses the current offset to preserve after the anchor set changes.

Link copied to clipboard
fun resolveAnchoredSettleTarget(anchorsPx: List<Float>, startOffsetPx: Float, currentOffsetPx: Float, velocityPxPerSecond: Float, touchSlopPx: Float, minFlingVelocityPxPerSecond: Float, thresholdPolicy: AnchoredThresholdPolicy = AnchoredThresholdPolicy()): AnchoredSettleResult

根据起点、当前位置和速度解析 anchored draggable 的最终 anchor。 Resolves the final anchor from the start offset, current offset, and velocity.

Link copied to clipboard
fun resolveLockAxis(dx: Float, dy: Float, orientation: GestureOrientation, touchSlop: Float): LockedAxis?

根据累计移动和方向策略决定是否锁定手势轴。 Resolves whether accumulated movement should lock the gesture axis.

Link copied to clipboard
fun resolveSwipeDecision(axis: SwipeDecisionAxis, total: Float, velocity: Float, minAnchor: Float?, maxAnchor: Float?, startAnchor: Float, touchSlop: Float, minFlingVelocity: Float): SwipeDecision

根据拖拽距离、速度和可用 anchor 解析 swipe 决策。 Resolves a swipe decision from drag distance, velocity, and available anchors.

Link copied to clipboard
fun shouldActivateTransform(panMotion: Float, zoomMotion: Float, rotationMotion: Float, touchSlop: Float): Boolean

判断 transform 手势是否已越过任一激活阈值。 Returns whether a transform gesture crossed any activation threshold.