CarouselFullTemplate
CarouselFullTemplate.CarouselItem
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
com.salesforce.marketingcloud.pushmodels.rich.carousel
CarouselFullTemplate is a data class that extends Template and is used to display a list of items in a carousel format for push notifications.
1data class CarouselFullTemplate(
2 val items: List<CarouselFullTemplate.CarouselItem>,
3 val selectedIndex: Int = DEFAULT_SELECTED_INDEX,
4 val style: Style? = null
5) : Template1CarouselFullTemplate(
2 items: List<CarouselFullTemplate.CarouselItem>,
3 selectedIndex: Int = DEFAULT_SELECTED_INDEX,
4 style: Style? = null
5)Parameters:
List<CarouselFullTemplate.CarouselItem> - The list of carousel items to displayInt - The initially selected item index (defaults to DEFAULT_SELECTED_INDEX)Style? - Optional styling configuration for the carousel (nullable, defaults to null)| Property | Type | Override | Description |
|---|---|---|---|
identifier | String? | Yes | Optional identifier for the template (defaults to null) |
items | List<CarouselFullTemplate.CarouselItem> | No | The list of items in the carousel |
selectedIndex | Int | No | The index of the currently selected item |
style | Style? | Yes | Optional style configuration |
type | Template.Type | Yes | The template type identifier |
1open override fun toString(): StringReturns a string representation of the CarouselFullTemplate object.
1data class CarouselItem(
2 val identifier: String,
3 val media: Media,
4 val title: Text? = null,
5 val subTitle: Text? = null,
6 val style: Style? = null,
7 val actions: List<Action>? = listOf(Action.OpenApp)
8) : Parcelable, PushViewA data class representing a single item in the carousel.
Constructor Parameters:
String - Unique identifier for the carousel itemMedia - Media content to display in the itemText? - Optional title text (nullable, defaults to null)Text? - Optional subtitle text (nullable, defaults to null)Style? - Optional styling for the item (nullable, defaults to null)List<Action>? - Optional list of actions (nullable, defaults to listOf(Action.OpenApp))Interfaces:
Parcelable - Implements Android serializationPushView - Implements push notification rendering