Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit f06e41b

Browse files
committed
fixed measurement of root with wrap content height
1 parent 3081f6c commit f06e41b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

library/src/main/java/com/etsy/android/grid/StaggeredGridView.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.etsy.android.grid;
1818

19-
import java.util.Arrays;
20-
2119
import android.content.Context;
2220
import android.content.res.TypedArray;
2321
import android.os.Parcel;
@@ -28,6 +26,8 @@
2826
import android.view.View;
2927
import android.view.ViewGroup;
3028

29+
import java.util.Arrays;
30+
3131
/**
3232
* A staggered grid view which supports multiple columns with rows of varying sizes.
3333
* <p/>
@@ -264,7 +264,7 @@ protected void onMeasureChild(final View child, final LayoutParams layoutParams)
264264
childHeightSpec = MeasureSpec.makeMeasureSpec(layoutParams.height, MeasureSpec.EXACTLY);
265265
}
266266
else {
267-
childHeightSpec = MeasureSpec.makeMeasureSpec(LayoutParams.WRAP_CONTENT, MeasureSpec.EXACTLY);
267+
childHeightSpec = MeasureSpec.makeMeasureSpec(LayoutParams.WRAP_CONTENT, MeasureSpec.UNSPECIFIED);
268268
}
269269
child.measure(childWidthSpec, childHeightSpec);
270270
}

0 commit comments

Comments
 (0)