DampedTransitioner
open class DampedTransitioner<T>(timer: Timer, scheduler: AnimationScheduler, decelerationTime: Measure<Time> = 1 * seconds, dampLevel: Measure<InverseUnits<Time>> = 10 / seconds) : CarouselBehavior.Transitioner<T> (source)
Carousel Transitioner that provides smooth, physics-based deceleration at the end of a Carousel's manual movement.
Parameters
timer
used to track current time
scheduler
used to manage animation
decelerationTime
indicating how quickly stops should decelerate to 0 velocity
dampLevel
indicating how much critical damping should be applied during stopping
See also
Constructors
Link copied to clipboard
constructor(timer: Timer, scheduler: AnimationScheduler, decelerationTime: Measure<Time> = 1 * seconds, dampLevel: Measure<InverseUnits<Time>> = 10 / seconds)
Functions
Link copied to clipboard
open override fun moveEnded(carousel: Carousel<T, *>, position: Vector2D, markers: Carousel.ItemMarkers, decelerateWhile: (Vector2D) -> Carousel.ItemMarkers): Completable
Notified whenever carousel has ended a manual move. This is where a transition animation would take place to smoothly move to the desired end item.
Link copied to clipboard
Link copied to clipboard
Notified whenever carousel has moves during a manual move (called after moveStarted). Transitioners can use this to keep track of things like movement velocity if they wish to provide smooth animation when moveEnded is called.