public class RevealState(initialValue: RevealValue)
A class to keep track of the state of the composable. It can be used to customise the behavior and state of the composable.
Parameters
| initialValue | The initial value of this state. |
Properties
currentValue
public val currentValue: RevealValue
The current RevealValue based on the status of the component.
targetValue
public val targetValue: RevealValue
The target RevealValue based on the status of the component. This will be equal to the currentValue if there is no animation running or swiping has stopped. Otherwise, this returns the next RevealValue based on the animation/swipe direction.
isAnimationRunning
public val isAnimationRunning: Boolean
Returns whether the animation is running or not.
offset
public val offset: Float
The current amount by which the revealable content has been revealed.
Functions
snapTo
public suspend fun snapTo(targetValue: RevealValue)
Snaps to the targetValue without any animation (if a previous item was already revealed, that item will be reset to the covered state with animation).
Parameters
| targetValue | The target RevealValue where the currentValue will be changed to. |
animateTo
public suspend fun animateTo(targetValue: RevealValue)
Animates to the targetValue with the animation spec provided.
Parameters
| targetValue | The target RevealValue where the currentValue will animate to. |