android / codelab-constraint-layout

Constraint Layout Codelab
https://codelabs.developers.google.com/codelabs/constraint-layout/
Apache License 2.0
471 stars 242 forks source link

2.0.0-beta3 - Flow can not toggle visibility of it's referenced id's #77

Open rustyhamsterr opened 4 years ago

rustyhamsterr commented 4 years ago

Hi, I encountered above mentioned problem today.

I created Views programmatically, added them to my root-constraint-layout and linked them to Flow by using setReferencedIds. While this gives me perfect control over the arrangement as it is inteded by Flow, it is not possible to hide and show referenced Elements. I assumed the behaviour to be equal to Group behaviour as the Flow knows its references and thereby should be enabled to hide them. The use of setVisibility(View.GONE) only hides the Flow itself, which disables the arrangement of referenced Views. The Views itself are stuck to the underlying constraintlayout (which seems correct, as they were added to it.)


Is the difference in behavior between Group and Flow intentionally or is it a bug? From my point of view the latter is the case.

Current workaround:

pqtuan86 commented 3 years ago

As of today, this issue is fixed in 2.1.0-beta02