Build apps faster with our new App builder! Check it out →

SwipeToRevealUndoAction

Android

Component in Wear Material Compose

A composable which can be used for setting the undo action of material [SwipeToRevealCard] and [SwipeToRevealChip].

Last updated:

Installation

dependencies {
   implementation("androidx.wear.compose:compose-material:1.5.0-alpha11")
}

Overloads

@ExperimentalWearMaterialApi
@Composable
fun SwipeToRevealUndoAction(
    revealState: RevealState,
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    interactionSource: MutableInteractionSource? = null,
    icon: (@Composable () -> Unit)? = null,
    label: (@Composable () -> Unit)? = null,
)

Parameters

namedescription
revealStateThe [RevealState] of the [SwipeToReveal] where this action is used.
onClickA lambda which gets triggered when the action is clicked.
modifier[Modifier] to be applied on the action
interactionSourceThe [MutableInteractionSource] representing the stream of interactions with this action.
iconAn optional icon which will be displayed on the action
labelAn optional label which will be displayed on the action. We strongly recommend to set [icon] and/or [label] for the action.
by @alexstyl