Pablo
11/11/2024, 2:59 PMLazyRow(
modifier = modifier
.fillMaxWidth(1f)
.background(Color.Yellow)
) {
itemsIndexed(element.childs) { index, element ->
Text(text = "$index", modifier.fillMaxWidth(0.3f).background(Color.Red))
element.childs contains two items, which I'm not using here to demonstrate it with a simpler way with that TextStylianos Gakis
11/11/2024, 3:10 PM@Preview
@Composable
private fun Preview() {
HedvigTheme {
Surface(color = HedvigTheme.colorScheme.backgroundPrimary) {
LazyRow(
modifier = Modifier
.fillMaxWidth(1f)
.background(Color.Yellow)
) {
itemsIndexed(List(5) { it.toString() }) { index, item ->
BasicText(text = "#$index:$item", Modifier.fillMaxWidth(0.3f).background(Color.Red))
}
}
}
}
}
Prints this to me.
So it all looks goodStylianos Gakis
11/11/2024, 3:10 PMPablo
11/11/2024, 3:13 PMPablo
11/11/2024, 3:14 PMPablo
11/11/2024, 3:14 PMPablo
11/11/2024, 3:14 PMitemsIndexed(element.childs) { index, element ->
Text(text = "$index", modifier.fillParentMaxWidth(0.3f).background(Color.Red))
Log.d("XXXX", "adding row item $index")
}
Pablo
11/11/2024, 3:14 PMPablo
11/11/2024, 3:15 PMmutableListOf()
with two items insideStylianos Gakis
11/11/2024, 3:18 PMmodifier
is in your case, nor what your list contains. If you paste everything I can run it.
btw also fishy that you are using a *mutable*list there.