Skip to content

Commit fde235c

Browse files
committed
Update docs to adapt new boxgrid span modifier
1 parent 8ad95bb commit fde235c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/span.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
The `content` composable lambda of grid layout extends `BoxGridScope`.
44
In the `BoxGridScope`, you can use `rowSpan` and `columnSpan` modifier to set span size of cell.
55

6-
The `rowSpan` and `columnSpan` modifiers take a lambda to calculate span.
7-
The lambda returns an integer value, the span size.
6+
The `span` modifiers take a lambda to calculate spans.
7+
The lambda returns a `BoxGridItemSpan` which represents row and column span size.
88
Or you can just pass `null` instead of lambda to use default span size, which is 1.
99

1010
```kotlin
1111
BoxGrid(
1212
rows = SimpleGridCells.Fixed(3),
1313
columns = SimpleGridCells.Fixed(3)
1414
) {
15-
Item(modifier = Modifier.rowSpan { 2 })
15+
Item(modifier = Modifier.span { BoxGridItemSpan(rowSpan = 2, columnSpan = 1) })
1616
Item(modifier = Modifier.column(2))
17-
Item(modifier = Modifier.row(1).column(1).columnSpan { 2 })
18-
Item(modifier = Modifier.row(2).columnSpan { 2 })
17+
Item(modifier = Modifier.row(1).column(1).span { BoxGridItemSpan(rowSpan = 1, columnSpan = 2) })
18+
Item(modifier = Modifier.row(2)span { BoxGridItemSpan(rowSpan = 1, columnSpan = 2) })
1919
}
2020
```
2121

0 commit comments

Comments
 (0)