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

onItemClick wrong position #7

Closed
AlexeyFreelancer opened this issue Jun 20, 2014 · 2 comments
Closed

onItemClick wrong position #7

AlexeyFreelancer opened this issue Jun 20, 2014 · 2 comments
Labels

Comments

@AlexeyFreelancer
Copy link

Hi @felipecsl

Maybe I'm wrong, but I think OnItemClickListener works incorrect:
position=0 for header
position=1 for first list item

So, should I manually decrement position into the onItemClick()?

onclick

@felipecsl
Copy link
Owner

@AlexeyFreelancer you're right. The click listener needs to be offset because of the exta item(s) added at the top. For now you can use (position - 1) if you're using a listView, or (position - numColumns) for gridView. I will submit a fix shortly. Thanks for reporting!

@felipecsl
Copy link
Owner

Please keep in mind the onItemClick() view and id arguments will still be referring to the wrong item. Only the position is fixed. Also, you have to attach the onItemClickListener via the QuickReturnAttacher, just like the onScrollListener.

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

No branches or pull requests

2 participants