AirshipEmbeddedCarousel

fun AirshipEmbeddedCarousel(embeddedId: String, modifier: Modifier = Modifier, selection: AirshipEmbeddedSelection = AirshipEmbeddedSelection.Priority, filterInstances: AirshipEmbeddedFilter? = null, indicator: @Composable BoxScope.(pagerState: PagerState, pageCount: Int) -> Unit? = null, previousArrow: @Composable (onClick: () -> Unit, enabled: Boolean) -> Unit? = null, nextArrow: @Composable (onClick: () -> Unit, enabled: Boolean) -> Unit? = null, placeholder: @Composable () -> Unit? = null)(source)

A container that displays all embedded content for the given embeddedId in a swipeable carousel.

When multiple pieces of embedded content share the same ID, each is shown as a separate page.

Parameters

embeddedId

The embedded ID.

modifier

The modifier to be applied to the layout.

selection

Controls which instances are paged, and in what order. AirshipEmbeddedSelection.ByComparator sorts by its comparator, AirshipEmbeddedSelection.ByInstanceId pages in the order its IDs are listed, showing only those, and AirshipEmbeddedSelection.ByAi pages in the order the model ranked, showing the placeholder rather than an unranked order while it decides; AirshipEmbeddedSelection.Priority preserves arrival order, matching AirshipEmbeddedViewGroup.

filterInstances

Optional AirshipEmbeddedFilter deciding which instances are eligible. Applied before selection, so an excluded instance never becomes a page. Remember the lambda: an unstable one re-subscribes on every recomposition.

indicator

Optional overlay composable for page indicators. Receives the PagerState and page count. Use AirshipEmbeddedCarouselDefaults.dotsIndicator for a simple default.

previousArrow

Optional composable for a "previous page" button, positioned at Alignment.CenterStart. Use AirshipEmbeddedCarouselDefaults.previousArrow for a simple accessible default.

nextArrow

Optional composable for a "next page" button, positioned at Alignment.CenterEnd. Use AirshipEmbeddedCarouselDefaults.nextArrow for a simple accessible default.

placeholder

Optional composable displayed when no embedded content is available.


fun AirshipEmbeddedCarousel(state: AirshipEmbeddedCarouselState, modifier: Modifier = Modifier, indicator: @Composable BoxScope.(pagerState: PagerState, pageCount: Int) -> Unit? = null, previousArrow: @Composable (onClick: () -> Unit, enabled: Boolean) -> Unit? = null, nextArrow: @Composable (onClick: () -> Unit, enabled: Boolean) -> Unit? = null, placeholder: @Composable () -> Unit? = null)(source)

A container that displays embedded carousel content for the embeddedId defined on the given AirshipEmbeddedCarouselState.

This composable may be useful when access to the carousel state is needed outside of the AirshipEmbeddedCarousel composable, e.g. to observe AirshipEmbeddedCarouselState.isAvailable.

Parameters

state

The AirshipEmbeddedCarouselState to be used by this carousel.

modifier

The modifier to be applied to the layout.

indicator

Optional overlay composable for page indicators.

previousArrow

Optional composable for a "previous page" button.

nextArrow

Optional composable for a "next page" button.

placeholder

Optional composable displayed when no embedded content is available.