Skip to content

Commit 7c40359

Browse files
imhappipaulfthomas
authored andcommitted
[Carousel][Docs] Adding docs for fullscreen carousel strategy
PiperOrigin-RevId: 546350583
1 parent c15a323 commit 7c40359

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/components/Carousel.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,30 @@ SnapHelper snapHelper = new CarouselSnapHelper();
144144
snapHelper.attachToRecyclerView(carouselRecyclerView);
145145
```
146146

147+
## Fullscreen strategy
148+
149+
![A contained, fullscreen Carousel](assets/carousel/fullscreen.png)
150+
151+
A fullscreen strategy shows one item at a time that takes up the entire space
152+
of the carousel.
153+
154+
You can use the fullscreen strategy by passing in the strategy to the
155+
CarouselLayoutManager constructor: `new CarouselLayoutManager(new
156+
FullScreenStrategy())`.
157+
158+
With the fullscreen strategy, it is recommended to use a vertical orientation
159+
carousel by either setting the orientation on the CarouselLayoutManager with the
160+
setter, or through its constructor: `new CarouselLayoutManager(new
161+
FullScreenCarouselStrategy(), RecyclerView.VERTICAL)`
162+
163+
It is also recommended to use the `CarouselSnapHelper`
164+
to snap to the nearest item like so:
165+
166+
```
167+
SnapHelper snapHelper = new CarouselSnapHelper();
168+
snapHelper.attachToRecyclerView(carouselRecyclerView);
169+
```
170+
147171
## Customizing carousel
148172

149173
### Item size
445 KB
Loading

0 commit comments

Comments
 (0)