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-beta2 issue with redrawing #73

Open LUwaisA opened 4 years ago

LUwaisA commented 4 years ago

It appears there is some issue with invalidating a ConstraintLayout. I have a button which starts off with a visibility of View.GONE. It's constraints are connecting it to other views in the ConstraintLayout which are visible. When a network call returns successfully I am changing the button's visibility to View.VISIBLE. When this happens the button is not appearing. I can use the layout inspector in Android Studio and the button is View.VISIBLE with a measuredHeight and measuredWidth of roughly the correct size. However it does show that the button is located at the top left of the ConstraintLayout and occupies no space (the button should actually be located near the bottom of the ConstraintLayout and occupy most of the width of it). It appears as though the layout is not being redrawn as all the state seems to be correct just the layout is inconsistent

Only-IceSoul commented 4 years ago

motion:visibilityMode="ignore" csStart.setVisibilityMode(id,ConstraintSet.VISIBILITY_MODE_IGNORE) csEnd.setVisibilityMode(id,ConstraintSet.VISIBILITY_MODE_IGNORE)

visibilityMode Beta 1 We added the ability to ignore the visibility of a view. This allows the applications to control the visibility and not have MotionLayout set it.

myView.visibility = GONE /VISIBLE