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
5 changes: 3 additions & 2 deletions library/src/main/java/me/gujun/android/taggroup/TagGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
final int heightSize = MeasureSpec.getSize(heightMeasureSpec);
final int contentWidth = widthSize - getPaddingLeft() - getPaddingRight();

measureChildren(widthMeasureSpec, heightMeasureSpec);

Expand All @@ -230,7 +231,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

if (child.getVisibility() != GONE) {
rowWidth += childWidth;
if (rowWidth > widthSize) { // Next line.
if (rowWidth > contentWidth) { // Next line.
rowWidth = childWidth; // The next row width.
height += rowMaxHeight + verticalSpacing;
rowMaxHeight = childHeight; // The next row max height.
Expand Down Expand Up @@ -1022,4 +1023,4 @@ public boolean deleteSurroundingText(int beforeLength, int afterLength) {
}
}
}
}
}