moveEnded

open fun moveEnded(carousel: Carousel<T, *>, position: Vector2D, markers: Carousel.ItemMarkers, decelerateWhile: (Vector2D) -> Carousel.ItemMarkers): Completable(source)

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.

The Transitioner should move carousel to an item markers when the returned Completable completes in order to have a smooth transition. Otherwise, the carousel will jump to the closest marker upon completion.

The decelerateWhile lambda is how the Transitioner updates the carousel's position over time. This lambda will return the current item marker offsets based on the new position. This allows the Transitioner to decide which item position to stop at as it transitions.

Parameters

carousel

in question

position

of carousel in its local coordinates at the time of stop

markers

of the previous and next items at the time of stop

decelerateWhile

is a lambda that should be called to update carousel's position and track the changing item markers to decide when to stop