Home > other >  Custom Compose Arrangement to add extra spacing at beginning and end of a LazyRow/LazyColumn
Custom Compose Arrangement to add extra spacing at beginning and end of a LazyRow/LazyColumn

Time:11-25

How can I create a custom Arrangement for LazyRow to add additional spacing at beginning and end, but have even spacing in between?

Start|< more space> Item 1 Item 2 Last Item |End

object CustomArrangement : Arrangement.Horizontal {
  override fun Density.arrange(
    totalSize: Int,
    sizes: IntArray,
    layoutDirection: LayoutDirection,
    outPositions: IntArray
  ) {

  }
}

enter image description here

  • Related