diff --git a/litho-sections-widget/src/main/java/com/facebook/litho/sections/widget/RecyclerCollectionEventsController.java b/litho-sections-widget/src/main/java/com/facebook/litho/sections/widget/RecyclerCollectionEventsController.java index ff55727dc41..059a18f74a5 100644 --- a/litho-sections-widget/src/main/java/com/facebook/litho/sections/widget/RecyclerCollectionEventsController.java +++ b/litho-sections-widget/src/main/java/com/facebook/litho/sections/widget/RecyclerCollectionEventsController.java @@ -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.