Skip to content

Commit caec8d2

Browse files
imhappileticiarossi
authored andcommittedSep 6, 2023
[Docs][Carousel] Add guidance in fullscreen strategy docs about portrait orientation
PiperOrigin-RevId: 563087886
1 parent 9a4888f commit caec8d2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎docs/components/Carousel.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,17 @@ FullScreenStrategy())`.
164164
With the fullscreen strategy, it is recommended to use a vertical orientation
165165
carousel by either setting the orientation on the CarouselLayoutManager with the
166166
setter, or through its constructor: `new CarouselLayoutManager(new
167-
FullScreenCarouselStrategy(), RecyclerView.VERTICAL)`
167+
FullScreenCarouselStrategy(), RecyclerView.VERTICAL)`. Stick to portrait
168+
orientation only, or adapt your layout to a different strategy when using
169+
landscape in order to maintain the aspect ratios of your images.
170+
171+
It is also recommended to use the `CarouselSnapHelper`
172+
to snap to the nearest item like so:
173+
174+
```
175+
SnapHelper snapHelper = new CarouselSnapHelper();
176+
snapHelper.attachToRecyclerView(carouselRecyclerView);
177+
```
168178

169179
It is also recommended to use the `CarouselSnapHelper`
170180
to snap to the nearest item like so:

0 commit comments

Comments
 (0)
Please sign in to comment.