Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TagGroup.java #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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) {
}
}
}
}
}