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

Fix item place error when load more #164

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

YellowEyed
Copy link

When I use this StaggeredGridView, I add a footer view to show when loading more data from server. When load complete, the items placed like this:
screenshot_2014-12-23-14-34-23
the last item should place at right side, but it came to left side. So I check the code, find out the problem is like this: before load more, I have 20 items and a footer in this view, that's total 21 items. The footer's position is 20. So when I load more from server, there is only one item loaded from server and added to the view, and it's position is 20, the GridItemRecord at position 20 exist, it's a footer, and it's column is 0 due to uninitialized.
So the item is placed at left side(column 0).

@YellowEyed
Copy link
Author

The second commit is about a problem of clicking item not reponse. And here is the situation: I have two headers, the first one is selectable, and the second one is not. In this situation, click the second item currently attach in the StaggeredGridView has no response. The problem lies at this code mAdapter.isEnabled(motionPosition). motionPosition means the position of the item currently attached in the StaggeredGridView, not the position of the item in the adapter's data list, so it should be like this mAdapter.isEnabled(motionPosition + mFirstPosition).

@YellowEyed
Copy link
Author

The third commit is when I have a height changable footer, and I slide to the bottom and continue sliding up, the footer's height changes. And if the item with heigher bottom, pass the top edge of the view, it will be removed from this view. But it will be redrawn right away with bottom at the footer's top edge. So I change it to not remove the last second item.

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

Successfully merging this pull request may close these issues.

None yet

1 participant