Timo Drick
09/09/2023, 8:41 PMs3rius
09/09/2023, 9:07 PMval cornerRadius = 5.dp
LazyList {
items(yourListOfItems) { index, item ->
val cornerShape = when(index) {
0 -> RoundedCornerShape(topLeft = cornerRadius, topRight = cornerRadius)
yourListOfItems.size - 1 -> RoundedCornerShape(bottomLeft = cornerRadius, bottomRight = cornerRadius)
else -> null
}
Box(modifier = if (cornerShape != null) Modifier.clip(cornerShape) else Modifier) {
// Your item
}
}
}
Timo Drick
09/09/2023, 9:20 PMascii
09/09/2023, 9:38 PMandroid:requiresFadingEdge
), the only feedback we received about it was that people didn't like it. Most users (apparently) don't prefer any scrim/fade applied at the edges of scroll containers.
Consider a scrollbar instead.Timo Drick
09/09/2023, 9:55 PMdewildte
09/09/2023, 10:02 PMLazyListState
to observe visible items in the list. If the first item and the last item in your list of items are not contained in the list of visible items then you can apply an animation to the rounding of the list container.