PullToRefreshBox
Source set: Android
@Composable
public fun PullToRefreshBox(
isRefreshing: Boolean,
onRefresh: () -> Unit,
state: PullToRefreshState,
modifier: Modifier = Modifier,
contentAlignment: Alignment = Alignment.TopCenter,
indicator: @Composable BoxScope.() -> Unit = {
PullToRefreshDefaults.Indicator(
modifier = Modifier.align(Alignment.TopCenter),
isRefreshing = isRefreshing,
state = state,
)
},
enabled: Boolean = true,
threshold: Dp = PullToRefreshDefaults.PositionalThreshold,
content: @Composable BoxScope.() -> Unit,
)
Parameters
| isRefreshing | whether a refresh is occurring |
| onRefresh | callback invoked when the user gesture crosses the threshold, thereby requesting a refresh. |
| modifier | the Modifier to be applied to this container |
| state | the state that keeps track of distance pulled |
| contentAlignment | the default alignment inside the Box. |
| indicator | the indicator that will be drawn on top of the content when the user begins a pull or a refresh is occurring |
| enabled | whether nested scroll events should be consumed by this component |
| threshold | how much distance can be scrolled down before onRefresh is invoked |
| content | the content of the pull refresh container, typically a scrollable layout such as androidx.wear.compose.foundation.lazy.TransformingLazyColumn or a layout using androidx.compose.foundation.verticalScroll |