LazyTilesTileSchema

@SerialName(value = "LazyTiles")
@Serializable
data class LazyTilesTileSchema(val id: String, val events: SerializableImmutableList<EventSchema>?, val style: StyleSchema, val searchableTerms: SerializableImmutableList<String>?, val visibility: TileSchema.Visibility, val tiles: SerializableImmutableList<TileSchema>? = null, val placeholderTiles: SerializableImmutableList<TileSchema>, val failureTiles: SerializableImmutableList<TileSchema>, val isFailureState: Boolean = false, val url: String, val method: HttpMethod, val body: AnySerializable?, val headers: Map<String, String>?) : TileSchema

Renders a Column whose content is fetched from the network at display time: the tile calls url with method, headers and body, expects a JSON array of tile schemas back, and renders them in place of its placeholder.

States:

On success the renderer dispatches a local LazyTilesTileEvents.OnTilesLoadedSuccessfully and the holder builds real tile holders from the decoded schemas; on a transport error or a decoding error it dispatches OnTilesLoadFailure and the holder flips isFailureState. A local OnReloadTiles event clears the loaded tiles and the failure flag, putting the tile back into its loading state.

Triggers dispatched:

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

  • OnLoadTilesStartEventTrigger — right before the request is sent.

  • OnLoadTilesSuccessEventTrigger — after the response has been received and decoded, so exactly one of this and the failure trigger fires per attempt.

  • OnLoadTilesFailureEventTrigger — on a request or decoding failure; the Throwable is passed as the event's incoming data.

Notes: the request is issued directly by the renderer, not through the event pipeline, so it is not affected by event chaining. Children are laid out in a plain Column with no scope CompositionLocal and no scrolling.

Constructors

Link copied to clipboard
constructor(id: String, events: SerializableImmutableList<EventSchema>?, style: StyleSchema, searchableTerms: SerializableImmutableList<String>?, visibility: TileSchema.Visibility, tiles: SerializableImmutableList<TileSchema>? = null, placeholderTiles: SerializableImmutableList<TileSchema>, failureTiles: SerializableImmutableList<TileSchema>, isFailureState: Boolean = false, url: String, method: HttpMethod, body: AnySerializable?, headers: Map<String, String>?)

Properties

Link copied to clipboard
@SerialName(value = "body")
val body: AnySerializable?
Link copied to clipboard
@SerialName(value = "events")
open override val events: SerializableImmutableList<EventSchema>?
Link copied to clipboard
@SerialName(value = "failureTiles")
val failureTiles: SerializableImmutableList<TileSchema>
Link copied to clipboard
@SerialName(value = "headers")
val headers: Map<String, String>?
Link copied to clipboard
@SerialName(value = "id")
open override val id: String
Link copied to clipboard
@SerialName(value = "isFailureState")
val isFailureState: Boolean
Link copied to clipboard
@SerialName(value = "method")
val method: HttpMethod
Link copied to clipboard
@SerialName(value = "placeholderTiles")
val placeholderTiles: SerializableImmutableList<TileSchema>
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 = "url")
val url: String
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