Object

PullToRefreshDefaults

Contains the default values for PullToRefreshBox

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
object PullToRefreshDefaults

Contains the default values for PullToRefreshBox

Properties

Common
Deprecated Use indicatorShape instead
val shape: Shape

The default shape for Indicator

Common
val indicatorShape: Shape

The default shape for Indicator

Common
Deprecated Use indicatorContainerColor instead
val containerColor: Color

The default container color for Indicator

Common
val indicatorContainerColor: Color

The default container color for Indicator

Common
val loadingIndicatorContainerColor: Color

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

Common
val indicatorColor: Color

The default indicator color for Indicator

Common
val loadingIndicatorColor: Color

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

Common
val PositionalThreshold = 80.dp

The default refresh threshold for rememberPullToRefreshState

Common
val IndicatorMaxDistance = PositionalThreshold

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

Common
val Elevation = ElevationTokens.Level2

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

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