androidx / constraintlayout

ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way
Apache License 2.0
1.07k stars 176 forks source link

[Compose] Fix chains for JSON and DSL #635

Closed oscar-ad closed 2 years ago

oscar-ad commented 2 years ago

The weight for JSON and DSL would get ignored.

For the DSL, the weight value would get overriden by ChainReference.

In JSON, the reference was being added twice per element when using weight, ultimately, only the first addition was being used, which didn't include values for weight and margins.

oscar-ad commented 2 years ago

Upon closer inspection, it seems that for JSON, the weight wasn't being ignored.

Since ChainReference would end up having repeated IDs, it would try to create "illegal" constraints, E.g: a - a - b - b - c - c