-carousel.md 2.6 KB

//tvlib/org.mjdev.tvlib.ui.components.carousel/Carousel

Carousel

[androidJvm]

@Composable

fun Carousel(modifier: Modifier = Modifier, itemCount: Int = 0, carouselState: CarouselState = remember(itemCount) { CarouselState() }, autoScrollDurationMillis: Long = CarouselDefaults.TimeToDisplayItemMillis, contentTransformStartToEnd: ContentTransform = CarouselDefaults.contentTransform, contentTransformEndToStart: ContentTransform = CarouselDefaults.contentTransform, carouselIndicator: @ComposableBoxScope.() -> Unit = {

    CarouselDefaults.IndicatorRow(
        itemCount = itemCount,
        activeItemIndex = carouselState.activeItemIndex,
        modifier = Modifier
            .align(Alignment.BottomEnd)
            .padding(16.dp),
    )
}, isAutoScrollActive: [MutableState](https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState.html)<[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)> = remember(itemCount) { mutableStateOf(false) }, focusState: [MutableState](https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState.html)<[FocusState](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusState.html)> = remember(itemCount) { mutableStateOf(FocusHelper(false)) }, content: @[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable.html)[AnimatedContentScope](https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentScope.html).(index: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)) -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) = {})