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

Public properties

RevealValue

The current RevealValue based on the status of the component.

Boolean

Returns whether the animation is running or not.

RevealActionType
Float

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

Float

The threshold, in pixels, where the revealed actions are fully visible but the existing content would be left in place if the reveal action was stopped.

Map<RevealValueFloat>

Defines the anchors for revealable content.

RevealValue

The target RevealValue based on the status of the component.

MutableFloatState

The total width of the component in pixels.

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.

Parameters
targetValue: RevealValue

The target RevealValue where the currentValue will be changed to.

See also
swipeableV2

Public properties

currentValue

Added in 1.2.0
val currentValueRevealValue

The current RevealValue based on the status of the component.

See also
swipeableV2

isAnimationRunning

Added in 1.2.0
val isAnimationRunningBoolean

Returns whether the animation is running or not.

See also
swipeableV2

lastActionType

Added in 1.4.0
var lastActionTypeRevealActionType

offset

Added in 1.2.0
val offsetFloat

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

See also
swipeableV2

revealThreshold

Added in 1.5.0-alpha10
val revealThresholdFloat

The threshold, in pixels, where the revealed actions are fully visible but the existing content would be left in place if the reveal action was stopped. This threshold is used to create the anchor for RevealValue.RightRevealing. If there is no such anchor defined for RevealValue.RightRevealing, it returns 0.0f.

swipeAnchors

Added in 1.2.0
val swipeAnchorsMap<RevealValueFloat>

Defines the anchors for revealable content. These anchors are used to determine the width at which the revealable content can be revealed to and stopped without requiring any input from the user.

See also
swipeableV2

targetValue

Added in 1.2.0
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.

See also
swipeableV2

width

Added in 1.5.0-alpha10
val widthMutableFloatState

The total width of the component in pixels. Initialise to zero, updated when the width changes.