PullToRefreshDefaults

object PullToRefreshDefaults


Contains the default values for PullToRefreshBox

Summary

Public functions

Unit
@Composable
Indicator(
    state: PullToRefreshState,
    isRefreshing: Boolean,
    modifier: Modifier,
    containerColor: Color,
    colors: ProgressIndicatorColors,
    maxDistance: Dp
)

The default indicator for PullToRefreshBox.

Unit
@Composable
IndicatorBox(
    state: PullToRefreshState,
    isRefreshing: Boolean,
    modifier: Modifier,
    maxDistance: Dp,
    shape: Shape,
    containerColor: Color,
    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.

Public properties

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.

Dp

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

ProgressIndicatorColors

The default indicator colors for Indicator

Color

The default container color for Indicator

Shape

The default shape for Indicator

Public functions

Indicator

Added in 1.8.0-alpha01
@Composable
fun Indicator(
    state: PullToRefreshState,
    isRefreshing: Boolean,
    modifier: Modifier = Modifier,
    containerColor: Color = this.indicatorContainerColor,
    colors: ProgressIndicatorColors = this.indicatorColors,
    maxDistance: Dp = IndicatorMaxDistance
): Unit

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: PullToRefreshState

the state of this modifier, will use state.distanceFraction and maxDistance to calculate the offset

isRefreshing: Boolean

whether a refresh is occurring

modifier: Modifier = Modifier

the modifier applied to this layout

containerColor: Color = this.indicatorContainerColor

the container color of this indicator

colors: ProgressIndicatorColors = this.indicatorColors

the ProgressIndicatorColors used to resolve indicator and track colors

maxDistance: Dp = IndicatorMaxDistance

the max distance the indicator can be pulled down before a refresh is triggered on release

IndicatorBox

@Composable
fun IndicatorBox(
    state: PullToRefreshState,
    isRefreshing: Boolean,
    modifier: Modifier = Modifier,
    maxDistance: Dp = IndicatorMaxDistance,
    shape: Shape = indicatorShape,
    containerColor: Color = indicatorContainerColor,
    content: @Composable BoxScope.() -> Unit
): 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: PullToRefreshState

the state of this modifier, will use state.distanceFraction and maxDistance to calculate the offset

isRefreshing: Boolean

whether a refresh is occurring

modifier: Modifier = Modifier

the modifier applied to this layout

maxDistance: Dp = IndicatorMaxDistance

the max distance the indicator can be pulled down before a refresh is triggered on release

shape: Shape = indicatorShape

the Shape of this indicator

containerColor: Color = indicatorContainerColor

the container color of this indicator

content: @Composable BoxScope.() -> Unit

content for this IndicatorBox

Public properties

IndicatorMaxDistance

val IndicatorMaxDistance: 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.

PositionalThreshold

val PositionalThreshold: Dp

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

indicatorColors

val indicatorColors: ProgressIndicatorColors

The default indicator colors for Indicator

indicatorContainerColor

val indicatorContainerColor: Color

The default container color for Indicator

indicatorShape

Added in 1.8.0-alpha01
val indicatorShape: Shape

The default shape for Indicator