CarouselFullTemplate

Package 

com.salesforce.marketingcloud.pushmodels.rich.carousel

Description 

CarouselFullTemplate is a data class that extends Template and is used to display a list of items in a carousel format for push notifications.

Class Declaration 

1data class CarouselFullTemplate(
2    val items: List<CarouselFullTemplate.CarouselItem>,
3    val selectedIndex: Int = DEFAULT_SELECTED_INDEX,
4    val style: Style? = null
5) : Template

Constructors 

Primary Constructor 

1CarouselFullTemplate(
2    items: List<CarouselFullTemplate.CarouselItem>,
3    selectedIndex: Int = DEFAULT_SELECTED_INDEX,
4    style: Style? = null
5)

Parameters:

  • items: List<CarouselFullTemplate.CarouselItem> - The list of carousel items to display
  • selectedIndex: Int - The initially selected item index (defaults to DEFAULT_SELECTED_INDEX)
  • style: Style? - Optional styling configuration for the carousel (nullable, defaults to null)

Properties 

PropertyTypeOverrideDescription
identifierString?YesOptional identifier for the template (defaults to null)
itemsList<CarouselFullTemplate.CarouselItem>NoThe list of items in the carousel
selectedIndexIntNoThe index of the currently selected item
styleStyle?YesOptional style configuration
typeTemplate.TypeYesThe template type identifier

Methods 

toString() 

1open override fun toString(): String

Returns a string representation of the CarouselFullTemplate object.

Nested Types 

CarouselItem 

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, PushView

A data class representing a single item in the carousel.

Constructor Parameters:

  • identifier: String - Unique identifier for the carousel item
  • media: Media - Media content to display in the item
  • title: Text? - Optional title text (nullable, defaults to null)
  • subTitle: Text? - Optional subtitle text (nullable, defaults to null)
  • style: Style? - Optional styling for the item (nullable, defaults to null)
  • actions: List<Action>? - Optional list of actions (nullable, defaults to listOf(Action.OpenApp))

Interfaces:

  • Parcelable - Implements Android serialization
  • PushView - Implements push notification rendering

Module Information 

  • Module: Push Models Module v1.0.2
  • SDK: Salesforce Marketing Cloud Unified SDK 11.0.0
  • Target: androidJvm