Kyant
10/01/2025, 1:40 AMspacing parameter for the items in LazyColumn, it's very convenient.Zach Klippenstein (he/him) [MOD]
10/01/2025, 1:49 AMverticalArrangement = spacedBy(…)Kyant
10/01/2025, 2:42 AMandylamax
10/01/2025, 5:31 AMitem sectionJack Boswell
10/01/2025, 5:59 AMitem that has a Column with different sizing, but then the items in that column aren't lazy 🤔andylamax
10/01/2025, 6:54 AMLazyColumn {
items(data) { item ->
Item(
modifier = Modifier.padding(
top = when(item) {
is ItemA -> 10.dp
is ItemB -> 13.dp
else -> 5.dp
}
)
)
}
}
Because, asking to have spacing parameter on the LazyColum itself, and each item requiring a different spacing, would result into a very ugly APIKyant
10/03/2025, 2:44 AMitems(list, spacing = 8.dp) {}Kyant
10/03/2025, 2:45 AMitemsIndexed with Spacer in the item, it's too duplicatedandylamax
10/03/2025, 4:33 AMLazyList(
arrangement = Arrangement.spacedBy(8.dp)
) {
items(list) {
// hour code here
}
}
Doesn't this fit your use case?Jack Boswell
10/03/2025, 4:35 AMLazyList {
items(list1, arrangement = Arrangement.spacedBy(8.dp)) {
// hour code here
}
items(list2, arrangement = Arrangement.spacedBy(16.dp)) {
// hour code here
}
}andylamax
10/03/2025, 6:49 AMKyant
10/03/2025, 1:32 PMandylamax
10/03/2025, 1:36 PM