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

Exposed the PageChangeListener in the PageIndicator #98

Closed
wants to merge 1 commit into from
Closed

Exposed the PageChangeListener in the PageIndicator #98

wants to merge 1 commit into from

Conversation

massimobio
Copy link
Contributor

This is the solutions indicated by @devflow in #42

@daimajia
Copy link
Owner

daimajia commented May 4, 2015

Actually there is a better solution on #42. Cause let user involk PagerIndicator.setOnPageChangeListener will make them not easy to understand what they are doing.

I think we can overide ViewPagerEx.setOnPageChangeListenrer , using an ArrayList to save all the listener, and call it sequentially .

@massimobio
Copy link
Contributor Author

Sounds like a good idea. Thanks for looking into this.

@massimobio massimobio closed this May 4, 2015
@daimajia
Copy link
Owner

daimajia commented May 4, 2015

Any interesting to be a collaborator of this project?

@massimobio
Copy link
Contributor Author

I just recently switched to Android Studio and Gradle and I've never worked on a stand-alone library like this so I probably wouldn't be much help, but thanks for asking.
I will spend some more time with this library and if I feel more comfortable I'll contact you.

@daimajia
Copy link
Owner

daimajia commented May 5, 2015

@massimobio Great! Feel free to contact me when you are ready!

@massimobio
Copy link
Contributor Author

Could you point me to some documents or tutorials specifically for working with these kinds of libraries? I wasn't even able to get the demo app to compile correctly. I had to manually pull out the classes and drop them into my project. Gradle is great for using open source projects, but I'm still at a loss about how things work behind then scenes. I'm eager to learn so I can contribute.

@daimajia
Copy link
Owner

daimajia commented May 5, 2015

You can check this video to learn how to import GitHub project into Android Studio.
https://teamtreehouse.com/library/android-tools/git/pulling-down-github-projects-to-android-studio

Check this to learn how to make custom view.

Check this to learn how to working with GitHub collaborators (Git workflow):

:-D Any problem or question feel free to comment here.

@massimobio
Copy link
Contributor Author

Wonderful. Thank you very much.

@massimobio
Copy link
Contributor Author

Hi, I added an ArrayList of listeners in the ViewPagerEx and it works, but there is an issue with the position number coming form the infinite view pager being a big number that needs to be converted to the correct position like you did in PageIndicator:
int n = position % mItemCount;
I wouldn't want the user to have to do this, as he would expect a number between 0 and number of views, but I wasn't able to find out the number of slider views in the ViewPagerEx
mAdapter.getCount() does not return the number of items
mExpectedAdapterCount also is some large number
Any suggestions?

@daimajia
Copy link
Owner

daimajia commented May 6, 2015

This may help you, check it.

public int getRealCount() {
return adapter.getCount();
}

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.

2 participants