Package-level declarations

Types

Link copied to clipboard
class DefaultRotaryHapticHandler(scrollableState: ScrollableState, hapticsChannel: Channel<RotaryHapticsType>, hapticsThresholdPx: Long = 50) : RotaryHapticHandler

Default implementation of RotaryHapticHandler. It handles haptic feedback based on the scrollableState, scrolled pixels and hapticsThresholdPx. Haptic is not fired in this class, instead it's sent to hapticsChannel where it'll performed later.

Link copied to clipboard
class GenericMotionRotaryInputAccumulator(context: Context, onValueChange: (change: Float) -> Unit, eventAccumulationThresholdMs: Long = RotaryInputConfigDefaults.DEFAULT_EVENT_ACCUMULATION_THRESHOLD_MS, minValueChangeDistancePx: Float = RotaryInputConfigDefaults.DEFAULT_MIN_VALUE_CHANGE_DISTANCE_PX, rateLimitCoolDownMs: Long = RotaryInputConfigDefaults.DEFAULT_RATE_LIMIT_COOL_DOWN_MS)

Accumulator to trigger callbacks based on MotionEvent from rotary input.

Link copied to clipboard

Defaults for rotary modifiers

Link copied to clipboard

Interface for Rotary haptic feedback

Link copied to clipboard

Handles haptics for rotary usage

Link copied to clipboard
value class RotaryHapticsType(type: Int)

Rotary haptic types

Link copied to clipboard
Link copied to clipboard

An adapter which connects scrollableState to Rotary

Link copied to clipboard

A wrapper around VelocityTracker1D to provide support for rotary input.

Link copied to clipboard

An implementation of rotary scroll adapter for ScalingLazyColumn

Link copied to clipboard
class SnapParameters(val snapOffset: Int, val thresholdDivider: Float, val resistanceFactor: Float)

Parameters used for snapping

Functions

Link copied to clipboard
fun Modifier.onRotaryInputAccumulated(eventAccumulationThresholdMs: Long = RotaryInputConfigDefaults.DEFAULT_EVENT_ACCUMULATION_THRESHOLD_MS, minValueChangeDistancePx: Float = RotaryInputConfigDefaults.DEFAULT_MIN_VALUE_CHANGE_DISTANCE_PX, rateLimitCoolDownMs: Long = RotaryInputConfigDefaults.DEFAULT_RATE_LIMIT_COOL_DOWN_MS, isLowRes: Boolean = false, onValueChange: (change: Float) -> Unit): Modifier

Accumulates the scroll distances from RotaryScrollEvent and notifies changes with onValueChange once accumulated value is over the thresholds.

Link copied to clipboard
fun Modifier.onRotaryInputAccumulatedWithFocus(focusRequester: FocusRequester? = null, isLowRes: Boolean = false, onValueChange: (Float) -> Unit): Modifier

A focusable modifier that accumulates the scroll distances from RotaryScrollEvent and notifies changes with onValueChange once accumulated value is over the thresholds.

Link copied to clipboard

Remember disabled haptics handler

Link copied to clipboard
fun rememberRotaryHapticHandler(scrollableState: ScrollableState, throttleThresholdMs: Long = 30, hapticsThresholdPx: Long = 50, hapticsChannel: Channel<RotaryHapticsType> = rememberHapticChannel(), rotaryHaptics: RotaryHapticFeedback = rememberDefaultRotaryHapticFeedback()): RotaryHapticHandler

Remember rotary haptic handler.

Link copied to clipboard
Link copied to clipboard
fun Modifier.rotaryWithScroll(scrollableState: ScrollableState, focusRequester: FocusRequester = rememberActiveFocusRequester(), flingBehavior: FlingBehavior? = ScrollableDefaults.flingBehavior(), rotaryHaptics: RotaryHapticHandler = rememberRotaryHapticHandler(scrollableState), reverseDirection: Boolean = false): Modifier

A modifier which connects rotary events with scrollable. This modifier supports scroll with fling.

Link copied to clipboard
fun Modifier.rotaryWithSnap(rotaryScrollAdapter: RotaryScrollAdapter, focusRequester: FocusRequester = rememberActiveFocusRequester(), snapParameters: SnapParameters = RotaryDefaults.snapParametersDefault, rotaryHaptics: RotaryHapticHandler = rememberRotaryHapticHandler(rotaryScrollAdapter.scrollableState), reverseDirection: Boolean = false): Modifier

A modifier which connects rotary events with scrollable. This modifier supports snap.