https://kotlinlang.org logo
Title
d

Danish Ansari

05/05/2023, 3:44 PM
Hi We all know that
LazyColumn
inside
LazyColumn
is not allowed in Compose so that’s why I have used
Column
(Column’s content are populated with forEach loop) inside the
LazyColumn
and it looks quite okay UI wise but the problem arises during recomposition. For eg. even if one out of N item of Column gets recomposed, all N items are getting recomposed. And I believe this will not happen if I used
LazyColumn
, so what shall I do in this case? Short example: https://gist.github.com/mddanishansari/65fed3b80452d5ecff0ee91bd39fbb4b
j

Jan

05/05/2023, 7:25 PM
Nesting is supported, as long as the nested lazy column or row have a known size. (It can be changed dynamically)
c

Chris Sinco [G]

05/06/2023, 2:09 AM
What design are you trying to achieve? That would also help here. Because yes, Column will recompose all its children when state changes.
d

Danish Ansari

05/06/2023, 7:53 AM
@Jan how? I tried with
items(count)
but still getting
java.lang.IllegalStateException
as usual
@Chris Sinco [G] My UI is roughly something like this Main Screen has
LazyColumn
which contains multiple single items and one of it contains 3-4 grouped items (Collapsible/Expandable view) and each collapsible view contains 3-4 similar items which are populated with
List
j

Jan

05/06/2023, 10:13 AM
Try with a modifier to set fixed height
c

Colton Idle

05/06/2023, 4:52 PM
@Danish Ansari got a screenshot of the ui you're trying to accomplish
d

Danish Ansari

05/11/2023, 5:56 AM
@Colton Idle sorry for the late reply, I was on a short vacation can I DM you the screenshot personally because of the confidentiality?
c

Colton Idle

05/11/2023, 6:28 AM
sure