Is MotionLayout supported/recommend in Jetpack Com...
# compose-android
j
Is MotionLayout supported/recommend in Jetpack Compose? The main article I can find on developer.android.com shows examples using Views/XML.
c
i dont really think so. motion and animation seems to be a first class citizen in compose so i think you want to use the compose specific apis. IIRC. motionlayout was forked/based on constraintLayout, and CL is basically not used in compose (there is some support for it i think), but I used to use CL like every day when I was an android dev (pre compose) and after compose (for the last 5 years) i have not touched CL.
j
I’ve used Compose ContraintLayout twice in productions apps. Mostly to make sure edges of multiple children Composables are aligned. I kept running into issues weights using Row/Column which is why I opted for CL…. If MotionLayout is “soft” deprecated or at least fallen out of favor. Do you know what the recommended method for transitioning between two layouts/composables based on motion/gestures. For example, if I wanted to implement a collapsing mini player like this example.
c
im not at my computer (ill re-read that message a bit later) but have you seen this by chance? https://developer.android.com/develop/ui/compose/animation/choose-api
1
I think for something like that a SharedElement Transition might be what you're looking for. @Doris Liu what's your top 1 or 2 recs for getting that youtube-esque collapsing player working?
j
Doesn’t SharedElement transition meant to be done for “hands” off animations and not something that’s being actively interacted with via a swipe gesture?