PagerTileSchema

@Serializable
@SerialName(value = "Pager")
data class PagerTileSchema(val id: String, val tiles: SerializableImmutableList<TileSchema>, val events: SerializableImmutableList<EventSchema>?, val style: StyleSchema, val searchableTerms: SerializableImmutableList<String>?, val visibility: TileSchema.Visibility, val pageSize: PagerTileSchema.PageSizeSchema = PageSizeSchema.Fill, val pageSpacing: Int = 0, val contentPadding: Int = 0, val beyondViewportPageCount: Int = 0) : TileSchema

Renders a Compose HorizontalPager over tiles, one page per child. pageSize chooses between full-width pages (PageSizeSchema.Fill) and fixed-width pages (PageSizeSchema.Fixed, in dp); pageSpacing and contentPadding are dp values (the padding is horizontal only), and beyondViewportPageCount controls how many off-screen pages stay composed.

Page control: the tile listens to the screen broadcast channel and reacts to scroll-to-begin, scroll-to-end, next-page and previous-page commands addressed to its id, each optionally animated. The resulting page is clamped to the valid range, so asking for the next page on the last one (or the previous page on the first) is a no-op rather than an error.

Triggers dispatched:

  • OnDisplayEventTrigger — fired once when the tile enters composition (keyed by tile id).

  • OnPageChangedEventTrigger — fired whenever the settled current page changes (the initial page is skipped). The trigger is dispatched once per direction the new page matches, and each dispatch only reaches the events wired to that exact direction: Direction.Any always, Direction.Start when landing on the first page, Direction.End when landing on the last page, and Direction.Index(page) for the new index. Wire events against whichever direction you care about — wiring several means several chains run for the same page change.

Notes: the pager is horizontal only, and children are rendered by index without a scope CompositionLocal.

Constructors

Link copied to clipboard
constructor(id: String, tiles: SerializableImmutableList<TileSchema>, events: SerializableImmutableList<EventSchema>?, style: StyleSchema, searchableTerms: SerializableImmutableList<String>?, visibility: TileSchema.Visibility, pageSize: PagerTileSchema.PageSizeSchema = PageSizeSchema.Fill, pageSpacing: Int = 0, contentPadding: Int = 0, beyondViewportPageCount: Int = 0)

Types

Link copied to clipboard
@Serializable
sealed interface PageSizeSchema

Properties

Link copied to clipboard
@SerialName(value = "beyondViewportPageCount")
val beyondViewportPageCount: Int
Link copied to clipboard
@SerialName(value = "contentPadding")
val contentPadding: Int
Link copied to clipboard
@SerialName(value = "events")
open override val events: SerializableImmutableList<EventSchema>?
Link copied to clipboard
@SerialName(value = "id")
open override val id: String
Link copied to clipboard
@SerialName(value = "pageSize")
val pageSize: PagerTileSchema.PageSizeSchema
Link copied to clipboard
@SerialName(value = "pageSpacing")
val pageSpacing: Int
Link copied to clipboard
@SerialName(value = "searchableTerms")
open override val searchableTerms: SerializableImmutableList<String>?
Link copied to clipboard
@SerialName(value = "style")
open override val style: StyleSchema
Link copied to clipboard
@SerialName(value = "tiles")
val tiles: SerializableImmutableList<TileSchema>
Link copied to clipboard
@SerialName(value = "visibility")
open override val visibility: TileSchema.Visibility

Functions

Link copied to clipboard
open fun isGone(): Boolean
Link copied to clipboard
open fun isVisible(): Boolean