Skip to content

Commit

Permalink
[Docs][Carousel] Fix carousel docs
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 567342773
  • Loading branch information
imhappi authored and dsn5ft committed Sep 26, 2023
1 parent 31af945 commit 247240c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions docs/components/Carousel.md
Expand Up @@ -140,8 +140,7 @@ carousels with `match_parent` as the width will have more and more large items
as the screen size grows.

You can use the hero strategy by passing in the strategy to the
CarouselLayoutManager constructor: `new CarouselLayoutManager(new
HeroCarouselStrategy())`.
CarouselLayoutManager constructor: `CarouselLayoutManager(HeroCarouselStrategy())`.

With the hero strategy, it is recommended to use the `CarouselSnapHelper` to snap to the nearest item like so:

Expand All @@ -158,12 +157,11 @@ A fullscreen strategy shows one item at a time that takes up the entire space
of the carousel.

You can use the fullscreen strategy by passing in the strategy to the
CarouselLayoutManager constructor: `new CarouselLayoutManager(new
FullScreenCarouselStrategy())`.
CarouselLayoutManager constructor: `CarouselLayoutManager(FullScreenCarouselStrategy())`.

With the fullscreen strategy, it is recommended to use a vertical orientation
carousel by either setting the orientation on the CarouselLayoutManager with the
setter, or through its constructor: `new CarouselLayoutManager(new
setter, or through its constructor: `CarouselLayoutManager(
FullScreenCarouselStrategy(), RecyclerView.VERTICAL)`. Stick to portrait
orientation only, or adapt your layout to a different strategy when using
landscape in order to maintain the aspect ratios of your images.
Expand All @@ -187,8 +185,7 @@ way such that there is a visible effect of items getting smaller as it goes out
of the carousel bounds.

You can use the uncontained strategy by passing in the strategy to the
CarouselLayoutManager constructor: `new CarouselLayoutManager(new
UncontainedCarouselStrategy())`.
CarouselLayoutManager constructor: `CarouselLayoutManager(UncontainedCarouselStrategy())`.

As the uncontained strategy does not alter item sizes, it is ideal for use cases
where aspect ratios of the items must be maintained. However, this can lead to
Expand Down

0 comments on commit 247240c

Please sign in to comment.