Skip to content

What's New in 1.1 (Compose)

Oscar Adame Vazquez edited this page Sep 21, 2022 · 10 revisions

ConstraintLayout-compose 1.1 focuses on bringing more MotionLayout features in Compose.

Constraints can be created either via a Kotlin DSL (in modifiers or as a separate ConstraintSet), or via a JSON ConstraintSet.

Various examples can be found in this project.

New in Compose 1.1.0-alpha04

ConstraintLayout

  • Allow referencing helpers when creating barriers
  • Added API for Flow helper. See createFlow

MotionLayout

  • Added a DSL for MotionScene. See MotionSceneScope
  • Added a DSL for Transition. See TransitionScope
  • Support to force remeasure on every frame with MotionLayoutFlag.FullMeasure

MotionCarousel

  • Carousel API for Compose using MotionLayout

Known Issues

  • Content may not remeasure properly if it doesn’t recompose together with the ConstraintLayout/MotionLayout parent.

New in Compose 1.1.0-alpha01

MotionLayout

  • Limited support for onSwipe, drive the animation with swipes/dragging
  • Added rememberMotionLayoutState. When passed to a MotionLayout Composable, it may be used to animate the internal progress value and observe changes to it (within a Composable scope) made by onSwipe
  • Support for stagger, easing and quantized movements
  • Updated internals to better handle recomposition
  • Fixed MotionLayout laying out different when using a debugging flag
  • Minor performance improvements

Known Issues

  • When using onSwipe all drag events are consumed (i.e: onSwipe won’t work well with LazyList)
  • MotionLayout #526: Possible crashes when using compose 1.1.X