Remon Shehata
07/07/2023, 11:43 AMLazyColumn(modifier = modifier.fillMaxWidth()) {
items(list1){
it.list2.forEach{ list2Item->
ItemView(list2Item)
}
}
}
is this lazy column working as expected from the reusing the views point?
I tried to make 2 nested lazy columns but it didn't workBilagi
07/07/2023, 12:08 PMLazyColumn(modifier = modifier.fillMaxWidth()) {
items(list1) { listItem ->
listItem.list2.flatten().forEach { list2Item ->
ItemView(list2Item)
}
}
}
Remon Shehata
07/07/2023, 12:32 PMAlbert Chang
07/07/2023, 3:05 PMLazyColumn(modifier = modifier.fillMaxWidth()) {
list1.forEach {
items(it.list2) { list2Item->
ItemView(list2Item)
}
}
}
Remon Shehata
07/07/2023, 4:51 PMLoney Chou
07/07/2023, 5:47 PMitem {}
in between lists.Loney Chou
07/07/2023, 5:50 PMval listOfLists = listOf(
"Fruits" to listOf("Apple")
)
listOfLists.forEach { (title, list) ->
item {
Text(title)
}
items(list) { item ->
// ...
}
}