AdaptiveVisibilityTileSchema

@Serializable
@SerialName(value = "AdaptiveVisibility")
data class AdaptiveVisibilityTileSchema(val id: String, val tiles: SerializableImmutableList<TileSchema>, val events: SerializableImmutableList<EventSchema>?, val style: StyleSchema, val searchableTerms: SerializableImmutableList<String>?, val visibility: TileSchema.Visibility, val widthVisibility: AdaptiveVisibilityTileSchema.WidthVisibility, val heightVisibility: AdaptiveVisibilityTileSchema.HeightVisibility) : TileSchema

Conditionally renders tiles based on the current window size class, read from currentWindowAdaptiveInfoV2(). The children are composed only when both widthVisibility and heightVisibility are satisfied; otherwise nothing is emitted at all — the children are not composed, not merely hidden.

Breakpoint comparison: the current window is ranked against the Material window size class bounds (width: Compact < Medium < Expanded < Large < ExtraLarge; height: Compact < Medium < Expanded). WidthVisibility.VisibleFrom / HeightVisibility.VisibleFrom are satisfied when the current rank is above the given breakpoint (exclusive), so VisibleFrom(Medium) shows from Expanded upwards. WidthVisibility.VisibleUntil / HeightVisibility.VisibleUntil are satisfied when the current rank is at or below the given breakpoint (inclusive), so VisibleUntil(Medium) covers Compact and Medium.

Triggers dispatched:

  • OnDisplayEventTrigger — fired once when the tile enters composition (keyed by tile id), regardless of whether the breakpoints are satisfied.

  • OnWidthBreakpointSatisfiedEventTrigger / OnWidthBreakpointNotSatisfiedEventTrigger — fired on first composition and on every change of the width condition.

  • OnHeightBreakpointSatisfiedEventTrigger / OnHeightBreakpointNotSatisfiedEventTrigger — fired on first composition and on every change of the height condition.

The width and height triggers are independent: one may report "satisfied" while the other reports "not satisfied", and in that case the children still stay hidden.

Notes: when both conditions hold, the children are hosted in a Box carrying style and visibility, so they are stacked rather than emitted into the parent's scope.

Types

Link copied to clipboard
@Serializable
sealed interface HeightBreakpoint
Link copied to clipboard
@Serializable
sealed interface HeightVisibility
Link copied to clipboard
@Serializable
sealed interface WidthBreakpoint
Link copied to clipboard
@Serializable
sealed interface WidthVisibility

Properties

Link copied to clipboard
@SerialName(value = "events")
open override val events: SerializableImmutableList<EventSchema>?
Link copied to clipboard
@SerialName(value = "height_visibility")
val heightVisibility: AdaptiveVisibilityTileSchema.HeightVisibility
Link copied to clipboard
@SerialName(value = "id")
open override val id: String
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
Link copied to clipboard
@SerialName(value = "width_visibility")
val widthVisibility: AdaptiveVisibilityTileSchema.WidthVisibility

Functions

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