-
Hi, I finally started to work on simple world editor. I also use an Entity Component System called Fleks that helps a lot. But, i'm struggling on making a UI hierarchy system that would list all "Groups" and their hierarchy on the scene Currently I have this, which list all the Groups on the scene: But I struggle with LazyList and find a way to use Does someone have an idea ? Code:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To make a tree, you can build a flat list of the currently visible (i.e. expanded) tree items. Whenever you collapse or expand a tree node you simply rebuild this list. The individual items in this list should have a field There is a (relatively complex) Jetpack Compose example which implements a file tree this way. The file tree code is here. This is obviously Jetpack compose and not kool UI but the concept should work the same. |
Beta Was this translation helpful? Give feedback.
To make a tree, you can build a flat list of the currently visible (i.e. expanded) tree items. Whenever you collapse or expand a tree node you simply rebuild this list. The individual items in this list should have a field
treeDepth
which you can then use to set the margin / indent of the tree item in the lazy list.There is a (relatively complex) Jetpack Compose example which implements a file tree this way. The file tree code is here. This is obviously Jetpack compose and not kool UI but the concept should work the same.