Google is committed to advancing racial equity for Black communities. See how.

BackdropScaffoldState

@Stable class BackdropScaffoldState : SwipeableState<BackdropValue>
kotlin.Any
   ↳ androidx.compose.material.SwipeableState<androidx.compose.material.BackdropValue>
   ↳ androidx.compose.material.BackdropScaffoldState

State of the BackdropScaffold composable.

Summary

Public constructors
<init>(initialValue: BackdropValue, clock: AnimationClockObservable, animationSpec: AnimationSpec<Float> = SwipeableConstants.DefaultAnimationSpec, confirmStateChange: (BackdropValue) -> Boolean = { true }, snackbarHostState: SnackbarHostState = SnackbarHostState())

State of the BackdropScaffold composable.

Public methods
Unit
conceal(onConcealed: () -> Unit = null)

Conceal the back layer, with an animation.

Unit
reveal(onRevealed: () -> Unit = null)

Reveal the back layer, with an animation.

Companion functions
Saver<BackdropScaffoldState, *>
Saver(clock: AnimationClockObservable, animationSpec: AnimationSpec<Float>, confirmStateChange: (BackdropValue) -> Boolean, snackbarHostState: SnackbarHostState)

The default Saver implementation for BackdropScaffoldState.

Inherited functions
Properties
Boolean

Whether the back layer is concealed.

Boolean

Whether the back layer is revealed.

SnackbarHostState

The SnackbarHostState used to show snackbars inside the scaffold.

Inherited properties

Public constructors

<init>

BackdropScaffoldState(
    initialValue: BackdropValue,
    clock: AnimationClockObservable,
    animationSpec: AnimationSpec<Float> = SwipeableConstants.DefaultAnimationSpec,
    confirmStateChange: (BackdropValue) -> Boolean = { true },
    snackbarHostState: SnackbarHostState = SnackbarHostState())

State of the BackdropScaffold composable.

Parameters
initialValue: BackdropValue The initial value of the state.
clock: AnimationClockObservable The animation clock that will be used to drive the animations.
animationSpec: AnimationSpec<Float> = SwipeableConstants.DefaultAnimationSpec The default animation that will be used to animate to a new state.
confirmStateChange: (BackdropValue) -> Boolean = { true } Optional callback invoked to confirm or veto a pending state change.
snackbarHostState: SnackbarHostState = SnackbarHostState() The SnackbarHostState used to show snackbars inside the scaffold.

Public methods

conceal

fun conceal(onConcealed: () -> Unit = null): Unit

Conceal the back layer, with an animation.

Parameters
onConcealed: () -> Unit = null Optional callback invoked when the back layer has been concealed.

reveal

fun reveal(onRevealed: () -> Unit = null): Unit

Reveal the back layer, with an animation.

Parameters
onRevealed: () -> Unit = null Optional callback invoked when the back layer has been revealed.

Properties

isConcealed

val isConcealed: Boolean

Whether the back layer is concealed.

isRevealed

val isRevealed: Boolean

Whether the back layer is revealed.

snackbarHostState

val snackbarHostState: SnackbarHostState

The SnackbarHostState used to show snackbars inside the scaffold.

Companion functions

Saver

fun Saver(
    clock: AnimationClockObservable,
    animationSpec: AnimationSpec<Float>,
    confirmStateChange: (BackdropValue) -> Boolean,
    snackbarHostState: SnackbarHostState
): Saver<BackdropScaffoldState, *>

The default Saver implementation for BackdropScaffoldState.