BackdropScaffoldState
-
Cmn
class BackdropScaffoldState
State of the BackdropScaffold composable.
Summary
Public companion functions |
||
|---|---|---|
Saver<BackdropScaffoldState, *> |
Saver(The default |
Cmn
|
Public constructors |
|
|---|---|
This function is deprecated. This constructor is deprecated. |
Cmn
|
Public functions |
||
|---|---|---|
suspend Unit |
conceal()Conceal the back layer with animation and suspend until it if fully concealed or animation has been cancelled. |
Cmn
|
@FloatRange(from = 0.0, to = 1.0) Float |
progress(from: BackdropValue, to: BackdropValue)The fraction of the offset between |
Cmn
|
Float |
Require the current offset. |
Cmn
|
suspend Unit |
reveal()Reveal the back layer with animation and suspend until it if fully revealed or animation has been cancelled. |
Cmn
|
Public properties |
||
|---|---|---|
(BackdropValue) -> Boolean |
Optional callback invoked to confirm or veto a pending state change. |
Cmn
|
BackdropValue |
The current value of the |
Cmn
|
Boolean |
Whether the back layer is concealed. |
Cmn
|
Boolean |
Whether the back layer is revealed. |
Cmn
|
SnackbarHostState |
The |
Cmn
|
BackdropValue |
The target value the state will settle at once the current interaction ends, or the |
Cmn
|
Public companion functions
Saver
fun Saver(
animationSpec: AnimationSpec<Float>,
confirmStateChange: (BackdropValue) -> Boolean,
snackbarHostState: SnackbarHostState,
density: Density
): Saver<BackdropScaffoldState, *>
The default Saver implementation for BackdropScaffoldState.
Public constructors
BackdropScaffoldState
BackdropScaffoldState(
initialValue: BackdropValue,
animationSpec: AnimationSpec<Float> = BackdropScaffoldDefaults.AnimationSpec,
confirmValueChange: (BackdropValue) -> Boolean = { true },
snackbarHostState: SnackbarHostState = SnackbarHostState()
)
| Parameters | |
|---|---|
initialValue: BackdropValue |
The initial value of the state. |
animationSpec: AnimationSpec<Float> = BackdropScaffoldDefaults.AnimationSpec |
The default animation that will be used to animate to a new state. |
confirmValueChange: (BackdropValue) -> Boolean = { true } |
Optional callback invoked to confirm or veto a pending state change. |
snackbarHostState: SnackbarHostState = SnackbarHostState() |
The |
Public functions
conceal
suspend fun conceal(): Unit
Conceal the back layer with animation and suspend until it if fully concealed or animation has been cancelled. This method will throw CancellationException if the animation is interrupted
progress
fun progress(from: BackdropValue, to: BackdropValue): @FloatRange(from = 0.0, to = 1.0) Float
The fraction of the offset between from and to, as a fraction between 0f..1f, or 1f if from is equal to to.
| Parameters | |
|---|---|
from: BackdropValue |
The starting value used to calculate the distance |
to: BackdropValue |
The end value used to calculate the distance |
requireOffset
fun requireOffset(): Float
Require the current offset.
| Throws | |
|---|---|
kotlin.IllegalStateException |
If the offset has not been initialized yet |
reveal
suspend fun reveal(): Unit
Reveal the back layer with animation and suspend until it if fully revealed or animation has been cancelled. This method will throw CancellationException if the animation is interrupted
Public properties
confirmValueChange
val confirmValueChange: (BackdropValue) -> Boolean
Optional callback invoked to confirm or veto a pending state change.
snackbarHostState
val snackbarHostState: SnackbarHostState
The SnackbarHostState used to show snackbars inside the scaffold.
targetValue
val targetValue: BackdropValue
The target value the state will settle at once the current interaction ends, or the currentValue if there is no interaction in progress.