hey there guys! Anyone with experience on nesting ...
# compose
d
hey there guys! Anyone with experience on nesting a LazyColumn within a NestedScrollView so that we keep the app bar behavior working? We get this
Copy code
java.lang.IllegalStateException: Nesting scrollable in the same direction layouts like LazyColumn and Column(Modifier.verticalScroll()) 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()
1
z
The message clearly explains why it isn’t possible. Alternatively you could use the Item {} block inside LazyColumn
d
thing is the message does not reflect current scenario
I do already have sticky headers in place but need now to include it as a view of an traditional android view which already has an appBar with scrolling behavior
a
Here is why it isn't allowed. You can either implement the app bar in Compose or use
RecyclerView
with
ComposeView
.
😎 1
👍 1
i
The CoördinatorLayout doesn't work with a LazyColumn, but wrapping a LazyColumn in a ScrollView isn't the solution here. There should be a way to forward the nested scroll events from a LazyColumn to the CoördinatorLayout
👍 1
d
think the same as @ion. Also considering the "fully interoperable api"
@Albert Chang thanks and yes that sounds like a partial solution but will work, basically RecyclerView instead of LazyColumn, Frankenstein 😄
thanks a lot guys, helpful ideas came from this. Kind regards!