Package-level declarations

Types

Link copied to clipboard
open class Carousel<T, M : ListModel<T>>(model: M, itemVisualizer: ItemVisualizer<T, CarouselItem>) : View

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.

Link copied to clipboard
interface CarouselBehavior<T> : Behavior<Carousel<T, *>>

Controls how Carousels behave and are rendered. It provides the Presenter used for Carousels as well as controls how they transition between items.

Link copied to clipboard

Provides context about a Carousel's current state to ItemVisualizers.

Link copied to clipboard

Presenter that uses a constraint to determine the selected item's bounds within the Carousel.

Link copied to clipboard
class CubePresenter<T>(orientation: Orientation = Horizontal, camera: (viewPort: Size) -> Camera = { Camera(Point(it.width / 2, it.height / 2), 1000.0) }, itemConstraints: ConstraintDslContext.(Bounds) -> Unit = fill) : ConstraintBasedPresenter<T>

Shows contents of a Carousel as though they are the faces of a cubic shape that rotates as the frame changes.

Link copied to clipboard
open class DampedTransitioner<T>(timer: Timer, scheduler: AnimationScheduler, decelerationTime: Measure<Time> = 1 * seconds, dampLevel: Measure<InverseUnits<Time>> = 10 / seconds) : CarouselBehavior.Transitioner<T>

Carousel Transitioner that provides smooth, physics-based deceleration at the end of a Carousel's manual movement.

Link copied to clipboard
class DissolvePresenter<T>(easeOut: (Float) -> Float = { it }, easeIn: (Float) -> Float = { it }, itemConstraints: ConstraintDslContext.(Bounds) -> Unit = fill) : ConstraintBasedPresenter<T>

Shows contents of a Carousel one by one, and does an opacity fade between them as the frame changes.

Link copied to clipboard
class DynamicCarousel<T, M : DynamicListModel<T>>(model: M, itemVisualizer: ItemVisualizer<T, CarouselItem>) : Carousel<T, M>

A Carousel that renders and cycles through a potentially mutable 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.

Link copied to clipboard
class FlipPresenter<T>(orientation: Orientation = Horizontal, camera: (viewPort: Size) -> Camera = { Camera(Point(it.width / 2, it.height / 2), 1000.0) }, itemConstraints: ConstraintDslContext.(Bounds) -> Unit = fill) : ConstraintBasedPresenter<T>

Shows contents of a Carousel one by one, as though they were on 2D cards that flip as the frame changes.

Link copied to clipboard
typealias ItemsObserver<T, M> = (source: DynamicCarousel<T, M>, differences: Differences<T>) -> Unit
Link copied to clipboard
class LinearPresenter<T>(orientation: Orientation = Horizontal, spacing: (Size) -> Double = { 0.0 }, itemConstraints: ConstraintDslContext.(Bounds) -> Unit = fill) : ConstraintBasedPresenter<T>

Presenter that shows items in a continuous stream with optional spacing between them. Items are positioned in the Carousel using itemConstraints.

Link copied to clipboard
class ReflectionPresenter<T>(floorPaint: (Size) -> Paint = { (Black opacity 0.25f).paint }, itemConstraints: ConstraintDslContext.(Bounds) -> Unit = fill) : ConstraintBasedPresenter<T>

Shows contents of a Carousel one by one, as though they are hanging on walls that rotate when the frame changes.

Link copied to clipboard
class SlicerPresenter<T>(numSlices: Int = 5, orientation: Orientation = Vertical, itemConstraints: ConstraintDslContext.(Bounds) -> Unit = fill) : ConstraintBasedPresenter<T>

Shows contents of a Carousel one by one, and "slices" them into ribbons as it transitions between frames.

Functions

Link copied to clipboard
fun <T> dampedTransitioner(timer: Timer, scheduler: AnimationScheduler, decelerationTime: Measure<Time> = 1 * seconds, dampLevel: Measure<InverseUnits<Time>> = 10 / seconds, transition: (carousel: Carousel<T, *>, startItem: Int, endItem: Int, update: (progress: Float) -> Unit) -> Pausable): DampedTransitioner<T>

Creates a DampedTransitioner that calls transition when it needs to skip between frames.