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

Send the current page index to the renderPage function as a third property? #34

Open
race604 opened this issue Jan 26, 2016 · 2 comments

Comments

@race604
Copy link
Owner

race604 commented Jan 26, 2016

by @christopherabouabdo mentioned here #32

I also added in a bit of code to send the current page index to the renderPage function as a third property. This has been very helpful in my project, I'm open to discussion about leaving that in or taking it out, what do you think?

@race604
Copy link
Owner Author

race604 commented Jan 26, 2016

The parameter pageID just means page index for simple DataSource. I just want to keep renderPage() depends on data, not on ViewPager status. Could you share your scenario to make a better design?

@christopherabouabdo
Copy link
Contributor

In my project I have a video on each page. The videos all autoplay when the page is active and they stop when you transition away from that page. Passing the current page index allows me to handle conditional logic to test if the page being rendered is the currently active page.

Is there a way to handle this without modifying the renderPage function?

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