-
Notifications
You must be signed in to change notification settings - Fork 101
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
Item click incorrect position #21
Comments
ya so, when you add the following (the onlcikc listener) `carouselPicker.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
Note that it starts at |
@CWrecker, I am not looking for onPageChangeListener. I want to implement click on each carousel items. |
yes, that is what this does. the item is selected (Onclick) when it is in the center of the carousel. Give it a try. Put a toast message in one of the cases between |
You have some misunderstanding. I want to update viewpager position on item click. And you are saying to implement page change listener. |
so you want to make a a different function (a method) run when one of the items is clicked on? |
Yes. View pager position should be change on item click. |
ok, so when i did it, i could not find a way to directly add Onclick to each button. So used the code above to change a variable, say x, and then based on that variable i used another button (this time with a direct onclick function) to run the method/code i wanted. Let me know if this helps |
take a look at this StackExchange post if you need to. |
When I implement click listener on each item, it gives incorrect position.
Any one has solution?
The text was updated successfully, but these errors were encountered: