@ExperimentalWearFoundationApi
interface RevealScope


Summary

Public properties

RevealActionType

The last RevealActionType that was set in RevealState.

Float

The offset, in pixels, where the revealed actions are fully visible but the existing content would be left in place if the reveal action was stopped.

Extension functions

Unit
@ExperimentalWearMaterialApi
@Composable
RevealScope.SwipeToRevealPrimaryAction(
    revealState: RevealState,
    onClick: () -> Unit,
    icon: @Composable () -> Unit,
    label: @Composable () -> Unit,
    modifier: Modifier,
    interactionSource: MutableInteractionSource?
)

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

Unit
@ExperimentalWearMaterialApi
@Composable
RevealScope.SwipeToRevealSecondaryAction(
    revealState: RevealState,
    onClick: () -> Unit,
    modifier: Modifier,
    interactionSource: MutableInteractionSource?,
    content: @Composable () -> Unit
)

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

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

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

Public properties

lastActionType

Added in 1.4.0-alpha07
val lastActionTypeRevealActionType

The last RevealActionType that was set in RevealState. This may not be set if the state changed via interaction and not through API call.

revealOffset

Added in 1.2.0
val revealOffsetFloat

The offset, in pixels, where the revealed actions are fully visible but the existing content would be left in place if the reveal action was stopped. This offset is used to create the anchor for RevealValue.Revealing. If there is no such anchor defined for RevealValue.Revealing, it returns 0.0f.

Extension functions

SwipeToRevealPrimaryAction

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

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

Parameters
revealState: RevealState

The RevealState of the SwipeToReveal where this action is used.

onClick: () -> Unit

A lambda which gets triggered when the action is clicked.

icon: @Composable () -> Unit

The icon which will be displayed initially on the action

label: @Composable () -> Unit

The label which will be displayed on the expanded action

modifier: Modifier = Modifier

Modifier to be applied on the action

interactionSource: MutableInteractionSource? = null

The MutableInteractionSource representing the stream of interactions with this action.

SwipeToRevealSecondaryAction

@ExperimentalWearMaterialApi
@Composable
fun RevealScope.SwipeToRevealSecondaryAction(
    revealState: RevealState,
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable () -> Unit
): Unit

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

Parameters
revealState: RevealState

The RevealState of the SwipeToReveal where this action is used.

onClick: () -> Unit

A lambda which gets triggered when the action is clicked.

modifier: Modifier = Modifier

Modifier to be applied on the action

interactionSource: MutableInteractionSource? = null

The MutableInteractionSource representing the stream of interactions with this action.

content: @Composable () -> Unit

The composable which will be displayed on the action. It is recommended to keep this content as an Icon composable.

SwipeToRevealUndoAction

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

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

Parameters
revealState: RevealState

The RevealState of the SwipeToReveal where this action is used.

onClick: () -> Unit

A lambda which gets triggered when the action is clicked.

modifier: Modifier = Modifier

Modifier to be applied on the action

interactionSource: MutableInteractionSource? = null

The MutableInteractionSource representing the stream of interactions with this action.

icon: (@Composable () -> Unit)? = null

An optional icon which will be displayed on the action

label: (@Composable () -> Unit)? = null

An optional label which will be displayed on the action. We strongly recommend to set icon and/or label for the action.