I'm looking to display a tree structure, but I als...
# compose
a
I'm looking to display a tree structure, but I also need to be able to drag to reorder, and expand/collapse nodes in the tree. I've done some looking and can't seem to find any existing libraries that tick all those boxes. But thought I might poll the channel here to see if there is one I might be missing. If not, anyone have any tips on where to start making my own implementation? Maybe building it on top of LazyColumn?
o
Found this via search not sure if this is what you are looking for https://gist.github.com/antonshilov/ef8cd0a360a5cc0f823b2a4e85084720 ?
Found one but with RecyclerView https://github.com/oss-bandb/GraphView
a
the first one might be a good thing to base mine off of thanks, need to add drag and drop, but
this will be a multiplatform compose thing so cant use recyclerview
o
Feature Request: LazyColumn reorder items via long click drag h t tps://issuetracker.google.com/issues/181282427
a
I did it on my own without libraries, but without dragging either (no need for me). Maybe this could be improved for your case https://github.com/arkivanov/MVIKotlin/blob/master/mvikotlin-timetravel-client/app-desktop/src/jvmMain/kotlin/com/arkivanov/mvikotlin/timetravel/client/desktop/ui/ValueTree.kt
a
oh awesome thanks @Arkadii Ivanov this looks useful. I have a pure lazy column impl right now, it has drag and drop, but it doesnt have collapse, and the drag and drop doesn't understand the tree structure, so it makes for some awkward ergonomics where it's give move indices as if it were a flat list.