Skip to content

Commit

Permalink
Expose current snapped position
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensousa committed Aug 17, 2019
1 parent 515a406 commit c33c7a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public void attachToRecyclerView(@Nullable RecyclerView recyclerView) {
}
}

public int getCurrentSnappedPosition() {
return currentSnappedPosition;
}

public void smoothScrollToPosition(int position) {
scrollTo(position, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,8 @@ public void scrollToPosition(int position) {
delegate.scrollToPosition(position);
}

public int getCurrentSnappedPosition() {
return delegate.getCurrentSnappedPosition();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public void scrollToPosition(int position) {
delegate.scrollToPosition(position);
}

public int getCurrentSnappedPosition() {
return delegate.getCurrentSnappedPosition();
}

public interface SnapListener {
void onSnap(int position);
}
Expand Down

0 comments on commit c33c7a2

Please sign in to comment.