android / codelab-constraint-layout

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

ConstraintLayout ignores forceLayout() #57

Open MatrixDev opened 6 years ago

MatrixDev commented 6 years ago

ConstraintLayout doesn't clear its mLastMeasure* cached fields on forceLayout() but clears those in requestLayout():

public void requestLayout() { super.requestLayout(); this.mDirtyHierarchy = true; this.mLastMeasureWidth = -1; this.mLastMeasureHeight = -1; this.mLastMeasureWidthSize = -1; this.mLastMeasureHeightSize = -1; this.mLastMeasureWidthMode = 0; this.mLastMeasureHeightMode = 0; }

This leads to wrong values after measuring ConstraintLayout if size of any of its children has changed.

Version: com.android.support.constraint:constraint-layout:1.1.2