codelab-constraint-layout
codelab-constraint-layout copied to clipboard
2.0.0-beta3 - Flow can not toggle visibility of it's referenced id's
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:
- Additional group created and added to constraint-layout.
- Set Groups referencedIds equal to the Flow ids.
- change visibility for both Flow and Group
As of today, this issue is fixed in 2.1.0-beta02