https://kotlinlang.org logo
Title
s

Suser

01/14/2021, 5:21 AM
is constraint layout on compose desktop? maybe i need to add a dependency but i'm unsure how and documentation is a little thin.
2️⃣ 1
I'm assuming it's tied to the android implementation and it's just not available on desktop yet.
k

Kirill Grouchnikov

01/14/2021, 5:48 AM
It is not available for desktop at the moment
🙌 1
s

Suser

01/14/2021, 6:13 AM
@Kirill Grouchnikov hey, thanks for the reply. I'll just live without it for now.
s

suresh

01/14/2021, 8:05 AM
I am not an android dev, so sorry for the naive question. Whats the advantage of constraint layout over the one provided by default in Compose? Just looking into the documentation, i feel like the default compose layout is intuitive and easy.
s

seb

01/14/2021, 8:15 AM
ConstraintLayout allows for very complex layouts, and its subclass MotionLayout has a very powerful animation system. So, there’s value there.
a

Animesh Sahu

01/14/2021, 8:16 AM
Compose has well DSL for that, no?
s

seb

01/14/2021, 8:22 AM
If you’re referring to the Compose version of ConstraintLayout, that only works on Android. If you’re talking about Compose’s animation DSL, yes it exists, but so does one on Android. MotionLayout allows you to create very complex animations with ease — it’s less of an issue in Compose than what it would be in standard Android UI, as the DSL is nicer, but there’s a lot of complexity/granularity that MotionLayout can handle for you (also because of the great tooling around it in Android Studio)
k

Kirill Grouchnikov

01/14/2021, 2:52 PM
Notice that https://github.com/androidx/androidx/blob/androidx-main/compose/foundation/foundat[…]n/kotlin/androidx/compose/foundation/layout/ConstraintLayout.kt is in
androidMain
and depends on a bunch of classes in the
androidx.constraintlayout
namespace
☝️ 1