Carousel
A visual component that renders and cycles through a list of items of type T using a CarouselBehavior. Items are obtained via the model and presented such that a single item is "selected" at any time. Large ("infinite") lists of items are supported efficiently, since Carousel recycles the Views generated to render its items.
Carousel relies heavily on the Presenter provided by its behavior for the positioning and visual treatment of its underlying data. Different StageManagers can radically change the way a Carousel looks and functions.
Parameters
that holds the data for this Carousel
Inheritors
Types
Data structure defining where the previous and next items are located relative to their Carousel's origin. This data is provided to Transitioners at the end of a Carousel's manual movement, so they can decide which item to stop at.
An item bound to some data (and a View) within a Carousel that will be displayed. Presenters create these during Presenter.present to decide what is shown within a Carousel.
Properties
CarouselBehavior that governs the way this Carousel behaves.
The index the Carousel is closest to displaying in the "selected" slot at this moment. This value changes as the Carousel animates to a new targetItem.
Notifies of changes to the Carousel's nearestItem.
The previous item selected by the Carousel.
Notifies of changes to the Carousel's progress to its target. Listeners can then check nearestItem, progressToTargetItem and progressToNextItem to figure out exactly how the Carousel is positioned.
Where the Carousel is between nearestItem and the next index as it travels to targetItem. This value is always within [0-1]
.
Where the Carousel is between previousSelectedItem and targetItem as it travels to the latter. This value is always within [0-1]
.
The item being selected by the Carousel, even if that selection is in progress.
Determines whether the Carousel will wrap its values at the start and end.
Inherited properties
Functions
Finishes an ongoing manual move and indicates that the Carousel should return to a state where it has selected an item.
Manually moves the Carousel's contents to some to. This will stop any current transition and update the selected item as the values change.
Initiates manual movement of the Carousel. This will interrupt any other movement and get the Carousel ready for subsequent calls to moveManually.