Skip to content

Commit

Permalink
introduce RecyclerCollectionEventsController#scrollBy method
Browse files Browse the repository at this point in the history
Summary: Adding `public void requestScrollBy(int dx, int dy)` to `RecyclerCollectionEventsController` class

Reviewed By: mihaelao

Differential Revision: D15308395

fbshipit-source-id: db1356ca9dea7feb3a630532525f0c76f8699a56
  • Loading branch information
sergeynv authored and facebook-github-bot committed May 15, 2019
1 parent 83e9086 commit 0146857
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@ public void requestScrollToPositionWithSnap(
requestScrollToPositionInner(true, target, target, smoothScroller);
}

/**
* Send the {@link RecyclerCollectionComponent} a request to scroll the content by the given
* margins.
*/
public void requestScrollBy(int dx, int dy) {
final RecyclerView recyclerView = getRecyclerView();
if (recyclerView == null) {
return;
}

recyclerView.scrollBy(dx, dy);
}

/**
* @param animated whether the scroll will happen with animation.
* @param defaultTarget target to use as fallback.
Expand Down

0 comments on commit 0146857

Please sign in to comment.