https://kotlinlang.org logo
#compose
Title
# compose
y

Yang

10/14/2019, 3:20 AM
l

Luca Nicoletti

10/14/2019, 7:53 AM
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

louiscad

10/14/2019, 10:19 AM
It's because there are cases where using constraints is more practical, especially if you one day migrate from
View
based
ConstraintLayout
l

Luca Nicoletti

10/14/2019, 10:20 AM
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

louiscad

10/14/2019, 11:45 AM
Completely? I don't think so! Also, use the right tool for the job.
l

Luca Nicoletti

10/14/2019, 12:20 PM
Well, having a constraint layout allows you to have all the view as siblings 🙂
a

Adam Powell

10/14/2019, 1:51 PM
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

Luca Nicoletti

10/14/2019, 1:58 PM
Will there be a visual layout editor as well working with
Compose
? Something like
Apple
shown for
SwiftUI
?
a

Adam Powell

10/14/2019, 2:35 PM
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

Luca Nicoletti

10/14/2019, 2:36 PM
No, I mean visually seeing edits from Jetpack Compose code to a visual editor and viceversa
a

Adam Powell

10/14/2019, 2:37 PM
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

Luca Nicoletti

10/14/2019, 2:38 PM
Force them by tagging them 😈
😂 4
l

louiscad

10/14/2019, 3:19 PM
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

kioba

10/15/2019, 9:17 AM
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.
7 Views