PullToRefreshDefaults


Contains the default values for PullToRefreshBox

Summary

Public functions

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

The default indicator for PullToRefreshBox.

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

Cmn
Unit
@ExperimentalMaterial3ExpressiveApi
@Composable
LoadingIndicator(
    state: PullToRefreshState,
    isRefreshing: Boolean,
    modifier: Modifier,
    containerColor: Color,
    color: Color,
    elevation: Dp,
    maxDistance: Dp
)

A LoadingIndicator indicator for PullToRefreshBox.

Cmn

Public properties

Dp

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

Cmn
Dp

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

Cmn
Dp

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

Cmn
Dp

The default refresh threshold for rememberPullToRefreshState

Cmn
Color

This property is deprecated. Use indicatorContainerColor instead

Cmn
Color

The default indicator color for Indicator

Cmn
Color

The default container color for Indicator

Cmn
Shape

The default shape for Indicator

Cmn
Color

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

Cmn
Color

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

Cmn
Shape

This property is deprecated. Use indicatorShape instead

Cmn

Public functions

Indicator

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

The default indicator for PullToRefreshBox.

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

color: Color = this.indicatorColor

the color of this indicator

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 = Color.Unspecified,
    elevation: Dp = Elevation,
    content: @Composable BoxScope.() -> Unit
): 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: 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 = Color.Unspecified

the container color of this indicator

elevation: Dp = Elevation

the elevation for the indicator

content: @Composable BoxScope.() -> Unit

content for this IndicatorBox

LoadingIndicator

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

A LoadingIndicator indicator for PullToRefreshBox.

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.loadingIndicatorContainerColor

the container color of this indicator

color: Color = this.loadingIndicatorColor

the color of this indicator

elevation: Dp = LoadingIndicatorElevation

the elevation of this indicator

maxDistance: Dp = IndicatorMaxDistance

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

Public properties

Elevation

val ElevationDp

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

IndicatorMaxDistance

val IndicatorMaxDistanceDp

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

LoadingIndicatorElevation

val LoadingIndicatorElevationDp

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

PositionalThreshold

val PositionalThresholdDp

The default refresh threshold for rememberPullToRefreshState

containerColor

@ExperimentalMaterial3Api
val containerColorColor

The default container color for Indicator

indicatorColor

val indicatorColorColor

The default indicator color for Indicator

indicatorContainerColor

val indicatorContainerColorColor

The default container color for Indicator

indicatorShape

val indicatorShapeShape

The default shape for Indicator

loadingIndicatorColor

@ExperimentalMaterial3ExpressiveApi
val loadingIndicatorColorColor

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

loadingIndicatorContainerColor

@ExperimentalMaterial3ExpressiveApi
val loadingIndicatorContainerColorColor

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

shape

@ExperimentalMaterial3Api
val shapeShape

The default shape for Indicator