-
-
Save hitherejoe/e9696af7c95caca977ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void checkPostsDisplayOnGridView(List<Post> postsToCheck, int position) { | |
int columnCount = 5; | |
int size = postsToCheck.size() + position; | |
int pos = 0; | |
for (int i = position; i < size; i++) { | |
// The first item starts as selected, clicking on this would open the Playback Activity | |
checkItemAtPosition(i, postsToCheck.get(pos)); | |
// If we get to the end of the current row then we need to go down to the next one | |
if (((i + 1) % columnCount) == 0) { | |
int nextRowStart = i + columnCount; | |
int nextRowEnd = nextRowStart - columnCount + 1; | |
for (int n = nextRowStart; n >= nextRowEnd; n--) { | |
checkItemAtPosition(n, postsToCheck.get(n - position)); | |
} | |
// Set i to the start of the row beneath the one we've just checked | |
i = i + columnCount; | |
} | |
pos++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment