RevealState
class RevealState
A class to keep track of the state of the composable. It can be used to customise the behavior and state of the composable.
Summary
Public constructors |
|---|
RevealState(initialValue: RevealValue)Create a |
Public functions |
|
|---|---|
suspend Unit |
animateTo(targetValue: RevealValue)Animates to the |
suspend Unit |
snapTo(targetValue: RevealValue)Snaps to the |
Public properties |
|
|---|---|
RevealValue |
The current |
Boolean |
Returns whether the animation is running or not. |
Float |
The current amount by which the revealable content has been revealed. |
RevealValue |
The target |
Public constructors
RevealState
RevealState(initialValue: RevealValue)
Create a RevealState.
| Parameters | |
|---|---|
initialValue: RevealValue |
The initial value of this state. |
Public functions
animateTo
suspend fun animateTo(targetValue: RevealValue): Unit
Animates to the targetValue with the animation spec provided.
| Parameters | |
|---|---|
targetValue: RevealValue |
The target |
| Throws | |
|---|---|
kotlin.IllegalStateException |
if the target |
snapTo
suspend fun snapTo(targetValue: RevealValue): Unit
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: RevealValue |
The target |
Public properties
currentValue
val currentValue: RevealValue
The current RevealValue based on the status of the component.
isAnimationRunning
val isAnimationRunning: Boolean
Returns whether the animation is running or not.
offset
val offset: Float
The current amount by which the revealable content has been revealed.
targetValue
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.