Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (child.getVisibility() == View.GONE) {
continue;
}
measureChildWithMargins(
child,
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
0,
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
0
);
measureChild(child, widthMeasureSpec, heightMeasureSpec);
final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
childMarginWidth += (lp.leftMargin + lp.rightMargin);
childMarginHeight += (lp.topMargin + lp.bottomMargin);
Expand All @@ -101,7 +95,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
w = (mw * column) + paddingWidth + childMarginWidth;
h = (mh * row) + paddingHeight + childMarginHeight;

// If child decide to give no with or height, use default
// If child decide to give no width or height, use default
if (mw == 0) {
w = dpToPx(getContext(), DEFAULT_WIDTH) + childMarginWidth;
}
Expand Down Expand Up @@ -157,7 +151,7 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
// right
x + (y + 1) * cw - lp.rightMargin,
// bottom
(x + 1) * ch - lp.topMargin
(x + 1) * ch - lp.bottomMargin
);
}
}
Expand Down