is constraint layout on compose desktop? maybe i n...
# compose-desktop
s
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
It is not available for desktop at the moment
🙌 1
s
@Kirill Grouchnikov hey, thanks for the reply. I'll just live without it for now.
s
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
ConstraintLayout allows for very complex layouts, and its subclass MotionLayout has a very powerful animation system. So, there’s value there.
a
Compose has well DSL for that, no?
s
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
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