Is there a viable way to make an item in LazyColumn fill the available space when the list does not ...
a
Is there a viable way to make an item in LazyColumn fill the available space when the list does not fill all of the screen? With the following Arrangement implementation I was able to make a LazyColumn place the last item either at the middle of the available space or at the end (if the list is larger than the screen):
Copy code
@Stable
object TopLastAtMiddleArrangement : Arrangement.Vertical {

    override fun Density.arrange(
        totalSize: Int,
        sizes: IntArray,
        outPositions: IntArray
    ) {
        var currentOffset = 0
        sizes.forEachIndexed { index, size ->
            if (index == sizes.lastIndex) {
                val remaining = totalSize - currentOffset - size
                outPositions[index] = if (remaining > 0) (remaining / 2) + currentOffset else currentOffset
            } else {
                outPositions[index] = currentOffset
                currentOffset += size
            }
        }
    }
}
I was hoping to make an implementation able to, when there is space, expand the given item to fill the gap. I was hoping to be able to do that by changing the sizes array, but that didn't seem to work. Any ideas/suggestions?