Object

PullToRefreshDefaults

Contains the default values for PullToRefreshBox

Source set: Android
public object PullToRefreshDefaults

Contains the default values for PullToRefreshBox

Properties

indicatorShape

Source set: Android
public val indicatorShape: Shape = CircleShape

The default shape for Indicator

indicatorContainerColor

Source set: Android
public val indicatorContainerColor: Color

The default container color for Indicator

indicatorColors

Source set: Android
public val indicatorColors: ProgressIndicatorColors

The default indicator colors for Indicator

PositionalThreshold

Source set: Android
public val PositionalThreshold: Dp = 34.dp

The default drag distance to trigger a refresh, tailored for compact watch displays.

IndicatorMaxDistance

Source set: Android
public val IndicatorMaxDistance: Dp = 68.dp

The default maximum travel distance for Indicator and IndicatorBox to clear the top screen curvature and avoid colliding with androidx.wear.compose.material3.TimeText during refresh.

Functions

IndicatorBox

Source set: Android
@Composable
    public fun IndicatorBox(
        state: PullToRefreshState,
        isRefreshing: Boolean,
        modifier: Modifier = Modifier,
        maxDistance: Dp = IndicatorMaxDistance,
        shape: Shape = indicatorShape,
        containerColor: Color = indicatorContainerColor,
        content: @Composable BoxScope.() -> Unit,
    )

A Wrapper that handles the size, offset, clipping and background drawing for a pull-to-refresh indicator, useful when implementing custom indicators. PullToRefreshDefaults.Indicator uses this as the container.

Parameters

state the state of this modifier, will use state.distanceFraction and maxDistance to calculate the offset
isRefreshing whether a refresh is occurring
modifier the modifier applied to this layout
maxDistance the max distance the indicator can be pulled down before a refresh is triggered on release
shape the Shape of this indicator
containerColor the container color of this indicator
content content for this IndicatorBox

Indicator

Source set: Android
@Composable
    public fun Indicator(
        state: PullToRefreshState,
        isRefreshing: Boolean,
        modifier: Modifier = Modifier,
        containerColor: Color = this.indicatorContainerColor,
        colors: ProgressIndicatorColors = this.indicatorColors,
        maxDistance: Dp = IndicatorMaxDistance,
    )

The default indicator for PullToRefreshBox. This component draws a circular arrow based on PullToRefreshState.distanceFraction, and crossfades into a androidx.wear.compose.material3.CircularProgressIndicator when the refresh triggers.

Parameters

state the state of this modifier, will use state.distanceFraction and maxDistance to calculate the offset
isRefreshing whether a refresh is occurring
modifier the modifier applied to this layout
containerColor the container color of this indicator
colors the ProgressIndicatorColors used to resolve indicator and track colors
maxDistance the max distance the indicator can be pulled down before a refresh is triggered on release

Content updated: