28 lines
809 B
Kotlin
28 lines
809 B
Kotlin
package com.vanced.manager.ui.component.layout
|
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
import androidx.compose.foundation.lazy.LazyRow
|
|
import androidx.compose.foundation.lazy.items
|
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.Modifier
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
@Composable
|
|
fun <T> ScrollableItemRow(
|
|
items: List<T>,
|
|
modifier: Modifier = Modifier,
|
|
content: @Composable (T) -> Unit
|
|
) {
|
|
val state = rememberLazyListState()
|
|
LazyRow(
|
|
modifier = modifier,
|
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
|
state = state
|
|
) {
|
|
items(items) { item ->
|
|
content(item)
|
|
}
|
|
}
|
|
} |