Skip to content

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

Open
MertNYuksel wants to merge 2 commits into
ongakuer:masterfrom
MertNYuksel:master
Open

Add support for SnapHelpers that display multiple items after a snap event#144
MertNYuksel wants to merge 2 commits into
ongakuer:masterfrom
MertNYuksel:master

Conversation

@MertNYuksel

Copy link
Copy Markdown

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