Object

PullToRefreshDefaults

Contains the default values for PullToRefreshBox

Source set: Common
object PullToRefreshDefaults

Contains the default values for PullToRefreshBox

Properties

shape

Deprecated

Use indicatorShape instead

Source set: Common
val shape: Shape

The default shape for Indicator

indicatorShape

Source set: Common
val indicatorShape: Shape

The default shape for Indicator

containerColor

Deprecated

Use indicatorContainerColor instead

Source set: Common
val containerColor: Color

The default container color for Indicator

indicatorContainerColor

Source set: Common
val indicatorContainerColor: Color

The default container color for Indicator

loadingIndicatorContainerColor

Source set: Common
val loadingIndicatorContainerColor: Color

The default container color for the loading indicator that appears when pulling to refresh.

indicatorColor

Source set: Common
val indicatorColor: Color

The default indicator color for Indicator

loadingIndicatorColor

Source set: Common
val loadingIndicatorColor: Color

The default active indicator color for the loading indicator that appears when pulling to refresh.

PositionalThreshold

Source set: Common
val PositionalThreshold = 80.dp

The default refresh threshold for rememberPullToRefreshState

IndicatorMaxDistance

Source set: Common
val IndicatorMaxDistance = PositionalThreshold

The default maximum distance Indicator, IndicatorBox and LoadingIndicator can be pulled before a refresh is triggered.

Elevation

Source set: Common
val Elevation = ElevationTokens.Level2

The default elevation for an IndicatorBox that is applied to an Indicator

LoadingIndicatorElevation

Source set: Common
val LoadingIndicatorElevation = ElevationTokens.Level0

The default elevation for an IndicatorBox that is applied to a LoadingIndicator

Functions

IndicatorBox

@Composable
    fun IndicatorBox(
        state: PullToRefreshState,
        isRefreshing: Boolean,
        modifier: Modifier = Modifier,
        maxDistance: Dp = IndicatorMaxDistance,
        shape: Shape = indicatorShape,
        containerColor: Color = Color.Unspecified,
        elevation: Dp = Elevation,
        content: @Composable BoxScope.() -> Unit,
    )

A Wrapper that handles the size, offset, clipping, shadow, 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
elevation the elevation for the indicator
content content for this IndicatorBox

Indicator

@Composable
    fun Indicator(
        state: PullToRefreshState,
        isRefreshing: Boolean,
        modifier: Modifier = Modifier,
        containerColor: Color = this.indicatorContainerColor,
        color: Color = this.indicatorColor,
        maxDistance: Dp = IndicatorMaxDistance,
    )

The default indicator for PullToRefreshBox.

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
color the color of this indicator
maxDistance the max distance the indicator can be pulled down before a refresh is triggered on release

LoadingIndicator

@Composable
    fun LoadingIndicator(
        state: PullToRefreshState,
        isRefreshing: Boolean,
        modifier: Modifier = Modifier,
        containerColor: Color = this.loadingIndicatorContainerColor,
        color: Color = this.loadingIndicatorColor,
        elevation: Dp = LoadingIndicatorElevation,
        maxDistance: Dp = IndicatorMaxDistance,
    )

A LoadingIndicator indicator for PullToRefreshBox.

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
color the color of this indicator
elevation the elevation of this indicator
maxDistance the max distance the indicator can be pulled down before a refresh is triggered on release

Last updated: