constraintlayout icon indicating copy to clipboard operation
constraintlayout copied to clipboard

[Compose] Animate on constraint property change when 'animateChanges' is true.

Open oscar-ad opened this issue 3 years ago • 2 comments

Animate when we have something like:

var isVisible by remember {...}
...
ConstraintSet {
   ...
   constraint(id1) {
       visibility = if (isVisible) Visible else Gone
   }
}

Would probably require the ConstraintSet to be a Composable, or have something like 'rememberConstraintSet {...}'

oscar-ad avatar Dec 15 '21 21:12 oscar-ad

Reasoning is that this is likely a more common pattern than:

val constraintSet = if (isVisible) visibleConstraintSet else goneConstraintSet

oscar-ad avatar Dec 15 '21 21:12 oscar-ad

document the recommended (working) pattern.

jafu888 avatar Dec 16 '21 15:12 jafu888