Utkarsh Tiwari
04/05/2021, 4:12 PMAndré Kindwall
04/05/2021, 4:43 PMUtkarsh Tiwari
04/05/2021, 4:58 PMobject MultipleItemCarousel {
data class Item(
val thumbnail: @Composable () -> Unit
)
}
@Composable
fun MultipleItemCarousel(
enabled: Boolean = true,
carouselItems: List<MultipleItemCarousel.Item> = emptyList()
) {
LazyRow(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(DsSizing.measure4)
) {
items(
items = carouselItems,
itemContent = { item ->
item.thumbnail()
}
)
}
}
Thanks Andre! I didn’t set any clickable on the LazyRow. However, the item that I receive in my parent composable are composables themselves which have click listerners set to them. I want to add a disabled state to the row so that the users can’t interact with any items inside the row regardless of them having their indivisual onClick()s and also disable scroll. Basically, i want to disable any interactions on the whole component.Gabriel Melo
04/05/2021, 6:42 PMUtkarsh Tiwari
04/05/2021, 7:15 PMUtkarsh Tiwari
04/06/2021, 6:05 AMBox {
LazyRow()
// Blocks inputs when disabled
if (enabled.not()) {
Box(
modifier = Modifier.fillMaxSize()
.pointerInput(Unit) {
detectTapGestures()
}
)
}
}