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

Method not foound getAdapterPosition() for getting the postion in the RecyclerPagerAdapter.ViewHolder #10

Open
GuillemRoca opened this issue Sep 4, 2017 · 2 comments

Comments

@GuillemRoca
Copy link

Hi,

Thanks for the awesome library. I just found out that there is no method getAdapterPostion() for getting the Adapter position of the item represented by a current ViewHolder.

I'm getting an ArrayIndexOutOfBoundsException sometimes in the listener click callback because of this.

Is it possible to be implemented in the future?

Thanks

@AndroidDeveloperLB
Copy link

+1
I agree with that.
In the meanwhile, you can always add it on your own. In the class that extend from RecyclerPagerAdapter.ViewHolder , put a field of the adapterPosition, and update it in the onBindViewHolder .

@AndroidDeveloperLB
Copy link

You can see how to do it here:

https://stackoverflow.com/a/47547983/878126

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

2 participants