CarouselState


@ExperimentalTvMaterial3Api
class CarouselState


State of the Carousel which allows the user to specify the first item that is shown when the Carousel is instantiated in the constructor.

It also provides the user with support to pause and resume the auto-scroll behaviour of the Carousel.

Summary

Public companion properties

Saver<CarouselState, *>

The default Saver implementation for CarouselState.

Public constructors

CarouselState(initialActiveItemIndex: Int)

Public functions

ScrollPauseHandle
pauseAutoScroll(itemIndex: Int)

Pauses the auto-scrolling behaviour of Carousel.

Public properties

Int

The index of the item that is currently displayed by the carousel

Public companion properties

Saver

Added in 1.0.0-alpha10
val SaverSaver<CarouselState, *>

The default Saver implementation for CarouselState.

Public constructors

CarouselState

Added in 1.0.0-alpha10
CarouselState(initialActiveItemIndex: Int = 0)
Parameters
initialActiveItemIndex: Int = 0

the index of the first active item

Public functions

pauseAutoScroll

Added in 1.0.0-alpha10
fun pauseAutoScroll(itemIndex: Int): ScrollPauseHandle

Pauses the auto-scrolling behaviour of Carousel. The pause request is ignored if itemIndex is not the current item that is visible. Returns a ScrollPauseHandle that can be used to resume

Public properties

activeItemIndex

Added in 1.0.0-alpha10
val activeItemIndexInt

The index of the item that is currently displayed by the carousel