androidx.compose.material3.pulltorefresh
pullToRefresh
Function
No hand-written docs yet.
A Modifier that adds nested scroll to a container to support a pull-to-refresh gesture. When the user pulls a distance greater than threshold and releases the gesture, onRefresh is invoked. PullToRefreshBox applies this automatically.
Parameters
fun Modifier.pullToRefresh(
isRefreshing: Boolean,
state: PullToRefreshState,
enabled: Boolean = true,
threshold: Dp = PullToRefreshDefaults.PositionalThreshold,
onRefresh: () -> Unit,
): Modifier
isRefreshing: BooleanRequired
isRefreshing: BooleanRequiredwhether a refresh is occurring or not, if there is no gesture in progress when isRefreshing is false the state.distanceFraction will animate to 0f, otherwise it will animate to 1f
state: PullToRefreshStateRequired
state: PullToRefreshStateRequiredstate that keeps track of the distance pulled
enabled: BooleanOptional
enabled: BooleanOptionalDefault: true
whether nested scroll events should be consumed by this modifier
threshold: DpOptional
threshold: DpOptionalDefault: PullToRefreshDefaults.PositionalThreshold
how much distance can be scrolled down before onRefresh is invoked
onRefresh: () -> UnitRequired
onRefresh: () -> UnitRequiredcallback that is invoked when the distance pulled is greater than threshold
Library docs
A Modifier that adds nested scroll to a container to support a pull-to-refresh gesture. When the
user pulls a distance greater than threshold and releases the gesture, onRefresh is invoked.
PullToRefreshBox applies this automatically.