Akram Bensalem
09/06/2021, 6:57 PMjava.lang.IllegalStateException: Nesting scrollable in the same direction layouts like ScrollableContainer and LazyColumn is not allowed. If you want to add a header before the list of items please take a look on LazyColumn component which has a DSL api which allows to first add a header via item() function and then the list of items via items().
Any help ?Fredrik Larsen
09/06/2021, 7:59 PMJan Bína
09/06/2021, 9:27 PMLazyColumn
, LazyRow
will then be its first item
and items from your LazyColumn will be the last items. For the LazyGrid, take a look at its source code - it's just a LazyColumn with some special stuff inside - take that code and add it directly to your top level LazyColumn.nglauber
09/06/2021, 10:43 PMFredrik Larsen
09/07/2021, 6:31 AMJan Bína
09/07/2021, 6:43 AMLazyColumn {
item { LazyRow {} }
item {
Row {
Text("First grid item")
Text("Second grid item")
Text("Third grid item")
}
}
item {
Row {
Text("4th grid item")
Text("5th grid item")
Text("6th grid item")
}
}
item { Text("First item from bottom lazy column") }
item { Text("Second item from bottom lazy column") }
}
The only trickier part is creating items for the grid, for this, refer to LazyVerticalGrid
source code, you will have to copy its implementation. Is it clear now?Fredrik Larsen
09/07/2021, 7:36 AMJoost Klitsie
09/08/2021, 8:15 AMFredrik Larsen
09/08/2021, 8:49 AMJoost Klitsie
09/08/2021, 8:50 AMSamuel Rombs
09/08/2021, 5:39 PMFredrik Larsen
09/13/2021, 5:05 PM