-gallery.md 2.7 KB

//tvlib/org.mjdev.tvlib.ui.components.gallery/Gallery

Gallery

[androidJvm]

@Composable

fun Gallery(modifier: Modifier = Modifier, list: List<Any?> = listOf(Unit), index: Int = 0, delayedHide: Long = 5000, controlsState: MutableState<Boolean> = remember { mutableStateOf(true) }, currentItemIndex: MutableIntState = remember { mutableIntStateOf(index) }, focusRequester: FocusRequester = rememberFocusRequester(), imageScaleType: MutableState<ContentScale> = rememberSaveable(

    saver = contentScaleSaver
) {
    mutableStateOf(ContentScale.Crop)
}, listState: [TvLazyListState](https://developer.android.com/reference/kotlin/androidx/tv/foundation/lazy/list/TvLazyListState.html) = rememberTvLazyListState(), switchImageScale: () -&gt; [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) = {
    imageScaleType.value = when (imageScaleType.value) {
        ContentScale.Fit -&gt; ContentScale.Crop
        ContentScale.Crop -&gt; ContentScale.Fit
        else -&gt; ContentScale.Fit
    }
}, customContentViewer: @[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable.html)(src: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?, type: [ItemType](../org.mjdev.tvlib.helpers.media/-item-type/index.md), list: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)&lt;[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?&gt;) -&gt; [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) = { _, _, _ -&gt; })