ArcAnimationSpec
-
Cmn
@ExperimentalAnimationSpecApi
class ArcAnimationSpec<T : Any?> : DurationBasedAnimationSpec
DurationBasedAnimationSpec that interpolates 2-dimensional values using arcs of quarter of an Ellipse.
To interpolate with keyframes use KeyframesSpecConfig.using with an ArcMode.
As such, it's recommended that ArcAnimationSpec is only used for positional values such as: Offset, IntOffset or androidx.compose.ui.unit.DpOffset.
The orientation of the arc is indicated by the given mode.
Do note, that if the target value being animated only changes in one dimension, you'll only be able to get a linear curve.
Similarly, one-dimensional values will always only interpolate on a linear curve.
import androidx.compose.animation.core.ArcAnimationSpec import androidx.compose.animation.core.ArcMode.Companion.ArcAbove import androidx.compose.ui.geometry.Offset // Will interpolate the Offset in arcs such that the curve of the quarter of an Ellipse is above // the center. ArcAnimationSpec<Offset>(mode = ArcAbove)
Summary
Public constructors |
|
|---|---|
|
Cmn
|
Public functions |
||
|---|---|---|
open operator Boolean |
Cmn
|
|
open Int |
hashCode() |
Cmn
|
open VectorizedDurationBasedAnimationSpec<V> |
<V : AnimationVector> vectorize(converter: TwoWayConverter<T, V>)Creates a |
Cmn
|
Public properties |
||
|---|---|---|
Int |
Time the animation waits before starting. |
Cmn
|
Int |
Duration of the animation. |
Cmn
|
Easing |
|
Cmn
|
ArcMode |
Orientation of the arc. |
Cmn
|
Public constructors
ArcAnimationSpec
<T : Any?> ArcAnimationSpec(
mode: ArcMode = ArcBelow,
durationMillis: Int = DefaultDurationMillis,
delayMillis: Int = 0,
easing: Easing = FastOutSlowInEasing
)
| Parameters | |
|---|---|
mode: ArcMode = ArcBelow |
Orientation of the arc. |
durationMillis: Int = DefaultDurationMillis |
Duration of the animation. |
delayMillis: Int = 0 |
Time the animation waits before starting. 0 by default. |
easing: Easing = FastOutSlowInEasing |
|
Public functions
vectorize
open fun <V : AnimationVector> vectorize(converter: TwoWayConverter<T, V>): VectorizedDurationBasedAnimationSpec<V>
Creates a VectorizedAnimationSpec with the given TwoWayConverter.
The underlying animation system operates on AnimationVectors. T will be converted to AnimationVector to animate. VectorizedAnimationSpec describes how the converted AnimationVector should be animated. E.g. The animation could simply interpolate between the start and end values (i.e.TweenSpec), or apply spring physics to produce the motion (i.e. SpringSpec), etc)
| Parameters | |
|---|---|
converter: TwoWayConverter<T, V> |
converts the type |