Skip to content

Commit 9e64a1f

Browse files
imhappiraajkumars
authored andcommitted
[Carousel][Docs] Recommend snapping for multi-browse strategy
PiperOrigin-RevId: 588114790
1 parent 95e1c44 commit 9e64a1f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/components/Carousel.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ container.
116116
You can use the multi-browse strategy by passing in no arguments to the
117117
CarouselLayoutManager constructor: `CarouselLayoutManager()`.
118118

119+
With the multi-browse strategy, it is recommended to use the `CarouselSnapHelper` to snap to the nearest item like so:
120+
121+
```kt
122+
val snapHelper = CarouselSnapHelper()
123+
snapHelper.attachToRecyclerView(carouselRecyclerView)
124+
```
125+
119126
## Hero strategy
120127

121128
![A contained, hero Carousel](assets/carousel/hero.png)

0 commit comments

Comments
 (0)