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 RevealState.

Public functions

suspend Unit
animateTo(targetValue: RevealValue)

Animates to the targetValue with the animation spec provided.

suspend Unit
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).

Public properties

RevealValue

The current RevealValue based on the status of the component.

Boolean

Returns whether the animation is running or not.

Float

The current amount by which the revealable content has been revealed.

RevealValue

The target RevealValue based on the status of the component.

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 RevealValue where the currentValue will animate to.

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 RevealValue where the currentValue will be changed to.

Public properties

currentValue

Added in 1.5.0-beta01
val currentValueRevealValue

The current RevealValue based on the status of the component.

isAnimationRunning

Added in 1.5.0-beta01
val isAnimationRunningBoolean

Returns whether the animation is running or not.

offset

Added in 1.5.0-beta01
val offsetFloat

The current amount by which the revealable content has been revealed.

targetValue

Added in 1.5.0-beta01
val targetValueRevealValue

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.