PullToRefreshState

class PullToRefreshState(coroutineScope: CoroutineScope)

A UI state holder for the PullToRefresh composable.

This class manages the internal state machine for animations and nested scroll interactions, driven by the hoisted isRefreshing boolean.

Parameters

coroutineScope

A CoroutineScope used to launch animations and state updates.

Constructors

Link copied to clipboard
constructor(coroutineScope: CoroutineScope)

Properties

Link copied to clipboard

Cached NestedScrollConnection to avoid creating new instances on every scroll event.

Link copied to clipboard

The drag offset in pixels.

Link copied to clipboard

The progress of the pull gesture across the entire damped drag range, from 0.0 to 1.0 (where 1.0 represents the visual maximum). Unlike pullProgress which saturates at 1.0 once the threshold is reached, this value continues to grow as the user pulls further beyond the threshold.

Link copied to clipboard

The progress of the pull gesture, from 0.0 to 1.0, relative to the effective threshold (the larger of the visual threshold and the trigger threshold). With a trigger threshold below the visual threshold, RefreshState.ThresholdReached occurs before this reaches 1.0.

Link copied to clipboard

The current visual RefreshState of the component.

Link copied to clipboard

The pull progress threshold (0.0~1.0) at which a refresh is triggered, relative to the full damped drag range. Configured through rememberPullToRefreshState.

Link copied to clipboard

The visual scaling progress of the indicator, from 0.0 to 1.0. The scale-up completes at the smaller of the built-in visual threshold and the trigger threshold, so entering RefreshState.ThresholdReached always coincides with a fully scaled indicator.