rememberRevealState
Composable Function
Android
@SuppressLint("PrimitiveInCollection")
@ExperimentalWearMaterialApi
@Composable
public fun rememberRevealState(
initialValue: RevealValue = RevealValue.Covered,
animationSpec: AnimationSpec<Float> = SwipeToRevealDefaults.AnimationSpec,
confirmValueChange: (RevealValue) -> Boolean = { true },
positionalThreshold: (totalDistance: Float) -> Float =
SwipeToRevealDefaults.PositionalThreshold,
anchors: Map<RevealValue, Float> = createRevealAnchors(),
): RevealState
Create and remember
a RevealState
.
Parameters
initialValue | The initial value of the RevealValue . |
animationSpec | The animation which will be applied on the top content. |
confirmValueChange | Optional callback invoked to confirm or veto a pending state change. |
positionalThreshold | The positional threshold to be used when calculating the target state while the reveal is in progress and when settling after the revealing ends. This is the distance from the start of a transition. It will be, depending on the direction of the interaction, added or subtracted from/to the origin offset. It should always be a positive value. |
anchors | A map of RevealValue to the fraction where the content can be revealed to reach that value. Each anchor should be between 0..1 which will be adjusted based on total width. |