Spotted ConstraintLayout in Compose: <https://andr...
# compose
y
l
Is this to flatten views? Or are there any other reasons behind the development of such layout?
Just read this thread here (https://kotlinlang.slack.com/archives/CJLTWPH7S/p1563496950392900). Still wandering if there are other reason than flattening views & help developers - which are currently highly using
ConstraintLayout
- with the transition
l
It's because there are cases where using constraints is more practical, especially if you one day migrate from
View
based
ConstraintLayout
l
Constraint imho completely destroy the idea of a UI tree, you end up having a parent with tons of children and no hierarchy πŸ™‚
πŸ‘ 1
l
Completely? I don't think so! Also, use the right tool for the job.
l
Well, having a constraint layout allows you to have all the view as siblings πŸ™‚
a
It's a question of how you're expressing your layouts and code, not just the final tree shape. But since Compose emits nodes of the layout tree independent of the composable function call tree you can still introduce intermediate abstractions where it makes sense
ConstraintLayout plays very nicely with the visual layout editor as well for more complex arrangements
l
Will there be a visual layout editor as well working with
Compose
? Something like
Apple
shown for
SwiftUI
?
a
you mean something like Android Studio has had since ConstraintLayout first released? πŸ˜„
The Android Studio layout editor is the product, ConstraintLayout is the implementation detail
the ConstraintLayout setup is a pretty good basis for building those kinds of tools
l
No, I mean visually seeing edits from Jetpack Compose code to a visual editor and viceversa
a
We've got a lot of ideas, but I'll let the part of the team directly working on those things talk more about them if they're ready to πŸ™‚
l
Force them by tagging them 😈
πŸ˜‚ 4
l
I use ConstraintLayout without the layout editor, it's a "product" too. I got a bunch of extensions that cut a lot of verbosity and enable more reuse despite the flat hierarchy.
k
visual layout editor never worked in complex cases πŸ˜„. Do we still have plans for instant update on emulator/device? just like the experience with flutter? I think that would be a way bigger impact than keeping alive the visual editor and lot of people are looking forward to it
🀞🏼 2
I am interested to see constraint layout but I am surprised at the same time for the same reasons above. πŸ™‚ Guess it will be all about the api design.