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

ArrayIndexOutOfBoundsException #88

Open
smallcase-zz opened this issue Aug 30, 2014 · 0 comments
Open

ArrayIndexOutOfBoundsException #88

smallcase-zz opened this issue Aug 30, 2014 · 0 comments

Comments

@smallcase-zz
Copy link

The author me with your project, the StaggeredGridView.java class error [ArrayIndexOutOfBoundsException] error has been found, ask the author to revise
The original code segment:

final int startFrom;
if (span > 1) {
int lowest = mItemBottoms[nextCol];
for (int i = nextCol + 1; i < nextCol + span; i++) {
final int bottom = mItemBottoms[i];
if (bottom > lowest) {
lowest = bottom;
}
}
startFrom = lowest;
} else {
startFrom = mItemBottoms[nextCol];
}

The modified code segment:

final int startFrom;
if (span > 1) {
int lowest = mItemTops[nextCol];
for (int i = nextCol + 1; i < nextCol + span; i++) {
final int bottom = mItemTops[i];
if (bottom > lowest) {
lowest = bottom;
}
}
startFrom = lowest;
} else {
startFrom = mItemTops[nextCol];
}

[mItemBottoms] Should be changed to [mItemTops]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant