CarouselStrategy

public abstract class CarouselStrategy
extends Object

java.lang.Object
   ↳ com.google.android.material.carousel.CarouselStrategy
FullScreenCarouselStrategy A CarouselStrategy that fits one full-width or full-height item into a container to create a layout to browse one item at a time. 
HeroCarouselStrategy A CarouselStrategy that knows how to size and fit one large item and one small item into a container to create a layout to browse one 'hero' item at a time with a preview item. 
MultiBrowseCarouselStrategy A CarouselStrategy that knows how to size and fit large, medium and small items into a container to create a layout for quick browsing of multiple items at once. 
UncontainedCarouselStrategy A CarouselStrategy that does not resize the original item width and fits as many as it can into the container, cutting off the rest. 


A class responsible for creating a model used by a carousel to mask and offset views as they move along a scrolling axis.

Summary

Public constructors

CarouselStrategy()

Public methods

float getSmallItemSizeMax()

Returns the maximum small item size value.

float getSmallItemSizeMin()

Returns the minimum small item size value.

void setSmallItemSizeMax(float maxSmallItemSize)

Sets the maximum size for the small items.

void setSmallItemSizeMin(float minSmallItemSize)

Sets the minimum size for the small items.

Inherited methods

Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait(long arg0, int arg1)
final void wait(long arg0)
final void wait()

Public constructors

CarouselStrategy

public CarouselStrategy ()

Public methods

getSmallItemSizeMax

public float getSmallItemSizeMax ()

Returns the maximum small item size value.

Returns
float

getSmallItemSizeMin

public float getSmallItemSizeMin ()

Returns the minimum small item size value.

Returns
float

setSmallItemSizeMax

public void setSmallItemSizeMax (float maxSmallItemSize)

Sets the maximum size for the small items.

This method is a no-op for strategies that do not have small items.

Note that setting this size may impact other sizes in the carousel in order to fit the carousel strategy configuration.

Parameters
maxSmallItemSize float: size to set the small item to.

setSmallItemSizeMin

public void setSmallItemSizeMin (float minSmallItemSize)

Sets the minimum size for the small items.

This method is a no-op for strategies that do not have small items.

Note that setting this size may impact other sizes in the carousel in order to fit the carousel strategy configuration.

Parameters
minSmallItemSize float: size to set the small item to.