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

Add support for SnapHelpers that display multiple items after a snap event #144

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MertNYuksel
Copy link

CircleIndicator2 works fine with SnapHelpers like PagerSnapHelper since they only show a single recycler view item after a snap event. But it's not possible to use it with SnapHelpers such as SnapToBlock SnapHelper because they don't have one to one relationship between items and indicators. SnapToBlock SnapHelper
So in this pull request, I created SnapIndexController interface to abstract out SnapHelper, indicator index and item count relationship.

  • Create SnapIndexController interface
  • Delegate all calls that related to indicator index and indicator count to SnapIndexController in CircleIndicator2 class.
  • Create SimpleSnapIndexController class for SnapHelpers that shows a single item on a single page.
  • Add an overloading attachToRecyclerView method to CircleIndicator2

…ndicator index and item count relationship. This way we can use CircleIndicator2 with SnapHelpers that supports more than one item on a single webpage such as SnapToBlock. (https://stackoverflow.com/a/47580753/6644987)

- Create SnapIndexController interface
- Delegate all calls that related to indicator index and indicator count to SnapIndexController in CircleIndicator2 class.
- Create SimpleSnapIndexController class for SnapHelpers that shows a single item on a single page.
- Add an overloading attachToRecyclerView method to CircleIndicator2
@MertNYuksel MertNYuksel marked this pull request as ready for review July 24, 2020 13:04
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.

1 participant