Package com.google.accompanist.swiperefresh

Types

SwipeRefreshState
Link copied to clipboard
class SwipeRefreshState(isRefreshing: Boolean)
A state object that can be hoisted to control and observe changes for SwipeRefresh.

Functions

rememberSwipeRefreshState
Link copied to clipboard
fun rememberSwipeRefreshState(isRefreshing: Boolean): SwipeRefreshState
Creates a SwipeRefreshState that is remembered across compositions.
SwipeRefresh
Link copied to clipboard
fun SwipeRefresh(state: SwipeRefreshState, onRefresh: () -> Unit, modifier: Modifier = Modifier, swipeEnabled: Boolean = true, refreshTriggerDistance: Dp = 80.dp, indicatorAlignment: Alignment = Alignment.TopCenter, indicatorPadding: PaddingValues = PaddingValues(0.dp), indicator: @Composable() (state: SwipeRefreshState, refreshTrigger: Dp) -> Unit = { s, trigger -> SwipeRefreshIndicator(s, trigger) }, clipIndicatorToPadding: Boolean = true, content: @Composable() () -> Unit)
A layout which implements the swipe-to-refresh pattern, allowing the user to refresh content via a vertical swipe gesture.
SwipeRefreshIndicator
Link copied to clipboard
fun SwipeRefreshIndicator(state: SwipeRefreshState, refreshTriggerDistance: Dp, modifier: Modifier = Modifier, fade: Boolean = true, scale: Boolean = false, arrowEnabled: Boolean = true, backgroundColor: Color = MaterialTheme.colors.surface, contentColor: Color = contentColorFor(backgroundColor), shape: Shape = MaterialTheme.shapes.small.copy(CornerSize(percent = 50)), refreshingOffset: Dp = 16.dp, largeIndication: Boolean = false, elevation: Dp = 6.dp)
Indicator composable which is typically used in conjunction with SwipeRefresh.