Skip to content

Commit

Permalink
Fixes #3, counting error when there are child views with visibility s…
Browse files Browse the repository at this point in the history
…et to GONE.
  • Loading branch information
nex3z committed May 4, 2017
1 parent 0a369e4 commit f5d05b0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
int childNum = mChildNumForRow.get(row);
int rowHeight = mHeightForRow.get(row);
float spacing = mHorizontalSpacingForRow.get(row);
for (int i = 0; i < childNum; i++) {
for (int i = 0; i < childNum && childIdx < getChildCount();) {
View child = getChildAt(childIdx++);
if (child.getVisibility() == GONE) {
continue;
} else {
i++;
}

LayoutParams childParams = child.getLayoutParams();
Expand Down

0 comments on commit f5d05b0

Please sign in to comment.