CarouselStrategy

public abstract class CarouselStrategy
extends Object

java.lang.Object
   ↳ com.google.android.material.carousel.CarouselStrategy


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

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.