A simple gridview implementation with compose, any...
# compose
t
A simple gridview implementation with compose, anyone?
t
Here very basic but easy to adjust for your needs:
Copy code
@Composable
fun <T>ViewTableList(columns: Int = 2, item: List<T>, itemCallback: @Composable() (T) -> Unit) {
    key(item, columns) {
        LazyColumnItems(items = item.chunked(columns)) { rowList ->
            Row {
                rowList.forEach {
                    itemCallback(it)
                }
                val emptyRows = (columns - rowList.size)
                repeat(emptyRows) {
                    Spacer(modifier = Modifier.weight(1f))
                }
            }
        }
    }
}
t
Thanks.