AnimatedVector

data class AnimatedVector(@DrawableRes val resId: Int, val atEnd: Boolean = false, val replayMode: ToolkitIconReplayMode = ToolkitIconReplayMode.Restart, val loop: Boolean = false, val loopTrigger: ToolkitIconLoopTrigger = ToolkitIconLoopTrigger.Immediately) : ToolkitIcon.Animated(source)

Icon backed by an Animated Vector Drawable.

The drawable is expected to declare exactly two states, the first and the last frame, the way androidx.compose.animation.graphics reads an animated-vector. Components play it forward when they are clicked or become selected, and back to the first frame when they lose selection.

Constructors

Link copied to clipboard
constructor(@DrawableRes resId: Int, atEnd: Boolean = false, replayMode: ToolkitIconReplayMode = ToolkitIconReplayMode.Restart, loop: Boolean = false, loopTrigger: ToolkitIconLoopTrigger = ToolkitIconLoopTrigger.Immediately)

Properties

Link copied to clipboard
open override val atEnd: Boolean

Frame the drawable rests on while the component is neither selected nor clicked. false, the default, rests on the first frame.

Link copied to clipboard
open override val loop: Boolean

Whether the drawable animates continuously. Defaults to false, which keeps the click driven playback. The cycle follows replayMode.

Link copied to clipboard

What starts a declared loop. Defaults to ToolkitIconLoopTrigger.Immediately, which plays as soon as the icon is composed.

Link copied to clipboard

What a repeated click does once the animation already ran. Defaults to ToolkitIconReplayMode.Restart.

Link copied to clipboard
val resId: Int

The animated-vector resource.