Stay organized with collections
Save and categorize content based on your preferences.
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
Inherited methods |
From class
java.lang.Object
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.
getSmallItemSizeMin
public float getSmallItemSizeMin ()
Returns the minimum small item size value.
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.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# CarouselStrategy\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nCarouselStrategy\n================\n\n\n`\npublic\n\n\nabstract\nclass\nCarouselStrategy\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|-------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.google.android.material.carousel.CarouselStrategy |\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known direct subclasses [FullScreenCarouselStrategy](/reference/com/google/android/material/carousel/FullScreenCarouselStrategy), [HeroCarouselStrategy](/reference/com/google/android/material/carousel/HeroCarouselStrategy), [MultiBrowseCarouselStrategy](/reference/com/google/android/material/carousel/MultiBrowseCarouselStrategy), [UncontainedCarouselStrategy](/reference/com/google/android/material/carousel/UncontainedCarouselStrategy) |------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [FullScreenCarouselStrategy](/reference/com/google/android/material/carousel/FullScreenCarouselStrategy) | A [CarouselStrategy](/reference/com/google/android/material/carousel/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](/reference/com/google/android/material/carousel/HeroCarouselStrategy) | A [CarouselStrategy](/reference/com/google/android/material/carousel/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](/reference/com/google/android/material/carousel/MultiBrowseCarouselStrategy) | A [CarouselStrategy](/reference/com/google/android/material/carousel/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](/reference/com/google/android/material/carousel/UncontainedCarouselStrategy) | A [CarouselStrategy](/reference/com/google/android/material/carousel/CarouselStrategy) that does not resize the original item width and fits as many as it can into the container, cutting off the rest. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA class responsible for creating a model used by a carousel to mask and offset views as they move\nalong a scrolling axis.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------|---|\n| ` `[CarouselStrategy](/reference/com/google/android/material/carousel/CarouselStrategy#CarouselStrategy())`() ` |\n\n| ### Public methods ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` float` | ` `[getSmallItemSizeMax](/reference/com/google/android/material/carousel/CarouselStrategy#getSmallItemSizeMax())`() ` Returns the maximum small item size value. |\n| ` float` | ` `[getSmallItemSizeMin](/reference/com/google/android/material/carousel/CarouselStrategy#getSmallItemSizeMin())`() ` Returns the minimum small item size value. |\n| ` void` | ` `[setSmallItemSizeMax](/reference/com/google/android/material/carousel/CarouselStrategy#setSmallItemSizeMax(float))`(float maxSmallItemSize) ` Sets the maximum size for the small items. |\n| ` void` | ` `[setSmallItemSizeMin](/reference/com/google/android/material/carousel/CarouselStrategy#setSmallItemSizeMin(float))`(float minSmallItemSize) ` Sets the minimum size for the small items. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` 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() ` | ||\n\nPublic constructors\n-------------------\n\n### CarouselStrategy\n\n```\npublic CarouselStrategy ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### getSmallItemSizeMax\n\n```\npublic float getSmallItemSizeMax ()\n```\n\nReturns the maximum small item size value.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------|--------|\n| `float` | \u003cbr /\u003e |\n\n### getSmallItemSizeMin\n\n```\npublic float getSmallItemSizeMin ()\n```\n\nReturns the minimum small item size value.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------|--------|\n| `float` | \u003cbr /\u003e |\n\n### setSmallItemSizeMax\n\n```\npublic void setSmallItemSizeMax (float maxSmallItemSize)\n```\n\nSets the maximum size for the small items.\n\nThis method is a no-op for strategies that do not have small items.\n\nNote that setting this size may impact other sizes in the carousel\nin order to fit the carousel strategy configuration.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------------|------------------------------------------------|\n| `maxSmallItemSize` | `float`: size to set the small item to. \u003cbr /\u003e |\n\n### setSmallItemSizeMin\n\n```\npublic void setSmallItemSizeMin (float minSmallItemSize)\n```\n\nSets the minimum size for the small items.\n\nThis method is a no-op for strategies that do not have small items.\n\nNote that setting this size may impact other sizes in the carousel\nin order to fit the carousel strategy configuration.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------------|------------------------------------------------|\n| `minSmallItemSize` | `float`: size to set the small item to. \u003cbr /\u003e |"]]