Transitioner

interface Transitioner<T>(source)

Transitioners control how a Carousel transitions between items and how it concludes a manual move.

Inheritors

Functions

Link copied to clipboard
open 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
open fun moveStarted(carousel: Carousel<T, *>, position: Vector2D)

Notified whenever carousel has started a manual move. This is a good point for Transitioners to start tracking movement state if they wish to provide smooth animation when moveEnded is called.

Link copied to clipboard
open fun moveUpdated(carousel: Carousel<T, *>, position: Vector2D)

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.

Link copied to clipboard
open fun transition(carousel: Carousel<T, *>, startItem: Int, endItem: Int, update: (progress: Float) -> Unit): Pausable

Defines how a Carousel should transition between items. The default is to instantaneously jump between items. But this API allows for animating this movement.