Skip to content

Commit a4292a1

Browse files
wcshicketcham
authored andcommitted
Always compute layout width / height and call setMeasuredDimension even when there are no children instead of delegating to View (which was erroneously setting the height to take up all available space).
This fixes a bug that causes the chipgroup to erroneously takeover the entire height of the screen. PiperOrigin-RevId: 204810068
1 parent ba696b6 commit a4292a1

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

lib/java/com/google/android/material/internal/FlowLayout.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
110110
? width
111111
: Integer.MAX_VALUE;
112112

113-
if (getChildCount() == 0) {
114-
// Do not re-layout when there are no children.
115-
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
116-
return;
117-
}
118-
119113
int childLeft = getPaddingLeft();
120114
int childTop = getPaddingTop();
121115
int childBottom = childTop;

0 commit comments

Comments
 (0)