A2uiBasicCatalogV1

class A2uiBasicCatalogV1


Defines the API contract and schemas for the A2UI Basic Catalog V1 following the specification in https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json.

This class is intended to support the Basic Catalog specification 1.0 defined in https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json, support for it is planned.

This class acts as the API contract for any design system (e.g. Material 3, Jetpack Compose Glimmer, TV Compose) wishing to implement the basic catalog specification.

Summary

Nested types

Attributes to enhance accessibility of the A2UI Basic Catalog components when using assistive technologies like screen readers.

The A2UI "AudioPlayer" component for playing audio content from a URL.

The A2UI "Button" component for clickable buttons that dispatch actions.

Visual style variant for a Button.

The A2UI "Card" component for displaying content in a styled container.

The A2UI "CheckBox" component for displaying a checkable control with an associated label.

Holds the evaluated result of a client-side validation rule.

The A2UI "ChoicePicker" component for selecting one or more options from a list.

Display style for a ChoicePicker.

A selectable option within a ChoicePicker component.

Selection behavior variant for a ChoicePicker.

The A2UI "Column" component for arranging children vertically.

Alignment of children along the cross axis of a Column.

Arrangement of children along the main axis of a Column.

The A2UI "DateTimeInput" component for selecting date and/or time.

The A2UI "Divider" component for displaying a horizontal or vertical dividing line.

Orientation of a Divider.

The functions of the A2UI Basic Catalog V1, with one method for each function in the specification except the logical functions and, or, and not, which the catalog implements itself.

The A2UI "Icon" component for displaying an icon.

Built-in icon token for an Icon.

The visual source for the Icon.

An Icon drawn from a client-provided SVG path rather than a BuiltIn token.

An Icon named by a string that matches no predefined BuiltIn token.

The A2UI "Image" component for displaying an image from a URL.

Resizing behavior for an Image within its container.

Size and style variant for an Image.

The A2UI "List" component for displaying a scrollable list of components.

Alignment of children along the cross axis of a List.

Layout direction of the items in a List.

The A2UI "Modal" component for displaying a dialog window.

The A2UI "Row" component for displaying content in a horizontal layout.

Alignment of children along the cross axis of a Row.

Arrangement of children along the main axis of a Row.

The A2UI "Slider" component for selecting a numeric value within a range.

The A2UI "Tabs" component for displaying a set of tabs.

A resolved tab within a Tabs component.

The A2UI "Text" component for displaying text.

Typography style variant for a Text.

The A2UI "TextField" component for user text input.

Input style variant for a TextField.

The A2UI "Video" component for displaying a video from a URL.

Public companion functions

A2uiBasicCatalogV1.Functions
Functions(context: Context, localeProvider: A2uiLocaleProvider)

Creates the default implementations of A2uiBasicCatalogV1.Functions.

Public companion properties

String

The catalog ID for the A2UI Basic Catalog V1.

A2uiSchema

The standard theme schema for the A2UI Basic Catalog V1.

StaticA2uiProperty<Number>

The relative weight property for A2uiBasicCatalogV1 components.

Public constructors

A2uiBasicCatalogV1(
    text: A2uiBasicCatalogV1.Text,
    image: A2uiBasicCatalogV1.Image,
    icon: A2uiBasicCatalogV1.Icon,
    video: A2uiBasicCatalogV1.Video,
    audioPlayer: A2uiBasicCatalogV1.AudioPlayer,
    row: A2uiBasicCatalogV1.Row,
    column: A2uiBasicCatalogV1.Column,
    list: A2uiBasicCatalogV1.List,
    card: A2uiBasicCatalogV1.Card,
    tabs: A2uiBasicCatalogV1.Tabs,
    modal: A2uiBasicCatalogV1.Modal,
    divider: A2uiBasicCatalogV1.Divider,
    button: A2uiBasicCatalogV1.Button,
    textField: A2uiBasicCatalogV1.TextField,
    checkBox: A2uiBasicCatalogV1.CheckBox,
    choicePicker: A2uiBasicCatalogV1.ChoicePicker,
    slider: A2uiBasicCatalogV1.Slider,
    dateTimeInput: A2uiBasicCatalogV1.DateTimeInput,
    functions: A2uiBasicCatalogV1.Functions
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

A2uiBasicCatalogV1.AudioPlayer

the AudioPlayer component implementation

A2uiBasicCatalogV1.Button

the Button component implementation

A2uiBasicCatalogV1.Card

the Card component implementation

String

The unique identifier for this catalog.

A2uiBasicCatalogV1.CheckBox

the CheckBox component implementation

A2uiBasicCatalogV1.ChoicePicker

the ChoicePicker component implementation

A2uiBasicCatalogV1.Column

the Column component implementation

List<A2uiComponent>

The list of A2uiComponents supported by this catalog.

A2uiBasicCatalogV1.DateTimeInput

the DateTimeInput component implementation

A2uiBasicCatalogV1.Divider

the Divider component implementation

A2uiBasicCatalogV1.Functions

the Functions implementations

A2uiBasicCatalogV1.Icon

the Icon component implementation

A2uiBasicCatalogV1.Image

the Image component implementation

A2uiBasicCatalogV1.List

the List component implementation

A2uiBasicCatalogV1.Modal

the Modal component implementation

A2uiBasicCatalogV1.Row

the Row component implementation

A2uiBasicCatalogV1.Slider

the Slider component implementation

A2uiBasicCatalogV1.Tabs

the Tabs component implementation

A2uiBasicCatalogV1.Text

the Text component implementation

A2uiBasicCatalogV1.TextField

the TextField component implementation

A2uiSchema

The A2uiSchema defining the dynamic theme schema for this catalog.

A2uiBasicCatalogV1.Video

the Video component implementation

Extension functions

A2uiCatalog

Converts this basic catalog into an A2uiCatalog holding the catalog definitions.

Public companion functions

Functions

Added in 1.0.0-alpha02
fun Functions(
    context: Context,
    localeProvider: A2uiLocaleProvider = A2uiLocaleProvider.Default
): A2uiBasicCatalogV1.Functions

Creates the default implementations of A2uiBasicCatalogV1.Functions.

The Functions.openUrl implementation opens URLs with an android.content.Intent.ACTION_VIEW intent that only resolves to android.content.Intent.CATEGORY_BROWSABLE activities, and holds the application context of context. The Functions.formatNumber, Functions.formatCurrency, Functions.formatDate, and Functions.pluralize implementations use the locale of localeProvider. The other functions use the default implementations of A2uiBasicCatalogV1.Functions.

To customize individual functions, delegate to the returned implementation and override the methods of those functions, e.g., object : A2uiBasicCatalogV1.Functions by A2uiBasicCatalogV1.Functions(context) { … }. In such an object, super calls the default implementations of A2uiBasicCatalogV1.Functions, not the returned implementations: the default implementations use the default locale instead of localeProvider, and Functions.openUrl has no default implementation. To reuse a returned implementation, e.g., to open a URL after checking it, keep a reference to the returned A2uiBasicCatalogV1.Functions and call its method from the override.

Parameters
context: Context

Context whose application context opens URLs

localeProvider: A2uiLocaleProvider = A2uiLocaleProvider.Default

A2uiLocaleProvider of the locale used to format numbers, currencies, dates, and plurals, defaults to the default java.util.Locale

Returns
A2uiBasicCatalogV1.Functions

the default implementations of A2uiBasicCatalogV1.Functions

Public companion properties

CatalogId

Added in 1.0.0-alpha02
val CatalogId: String

The catalog ID for the A2UI Basic Catalog V1.

ThemeSchema

Added in 1.0.0-alpha02
val ThemeSchema: A2uiSchema

The standard theme schema for the A2UI Basic Catalog V1.

WeightProperty

Added in 1.0.0-alpha02
val WeightProperty: StaticA2uiProperty<Number>

The relative weight property for A2uiBasicCatalogV1 components.

Defined at the catalog level because it is supported across all A2uiBasicCatalogV1 components rather than belonging to a single component type.

Expected usage:

  • Components: Included in the A2uiComponent.properties list of all basic catalog components.

  • Parent components: Container components (such as Row and Column) access this property from child component properties to apply layout weights to their direct children.

Public constructors

A2uiBasicCatalogV1

Added in 1.0.0-alpha02
A2uiBasicCatalogV1(
    text: A2uiBasicCatalogV1.Text,
    image: A2uiBasicCatalogV1.Image,
    icon: A2uiBasicCatalogV1.Icon,
    video: A2uiBasicCatalogV1.Video,
    audioPlayer: A2uiBasicCatalogV1.AudioPlayer,
    row: A2uiBasicCatalogV1.Row,
    column: A2uiBasicCatalogV1.Column,
    list: A2uiBasicCatalogV1.List,
    card: A2uiBasicCatalogV1.Card,
    tabs: A2uiBasicCatalogV1.Tabs,
    modal: A2uiBasicCatalogV1.Modal,
    divider: A2uiBasicCatalogV1.Divider,
    button: A2uiBasicCatalogV1.Button,
    textField: A2uiBasicCatalogV1.TextField,
    checkBox: A2uiBasicCatalogV1.CheckBox,
    choicePicker: A2uiBasicCatalogV1.ChoicePicker,
    slider: A2uiBasicCatalogV1.Slider,
    dateTimeInput: A2uiBasicCatalogV1.DateTimeInput,
    functions: A2uiBasicCatalogV1.Functions
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

audioPlayer

Added in 1.0.0-alpha02
val audioPlayer: A2uiBasicCatalogV1.AudioPlayer

the AudioPlayer component implementation

button

Added in 1.0.0-alpha02
val button: A2uiBasicCatalogV1.Button

the Button component implementation

card

Added in 1.0.0-alpha02
val card: A2uiBasicCatalogV1.Card

the Card component implementation

catalogId

Added in 1.0.0-alpha02
val catalogId: String

The unique identifier for this catalog.

checkBox

Added in 1.0.0-alpha02
val checkBox: A2uiBasicCatalogV1.CheckBox

the CheckBox component implementation

choicePicker

Added in 1.0.0-alpha02
val choicePicker: A2uiBasicCatalogV1.ChoicePicker

the ChoicePicker component implementation

column

Added in 1.0.0-alpha02
val column: A2uiBasicCatalogV1.Column

the Column component implementation

components

Added in 1.0.0-alpha02
val components: List<A2uiComponent>

The list of A2uiComponents supported by this catalog.

dateTimeInput

Added in 1.0.0-alpha02
val dateTimeInput: A2uiBasicCatalogV1.DateTimeInput

the DateTimeInput component implementation

divider

Added in 1.0.0-alpha02
val divider: A2uiBasicCatalogV1.Divider

the Divider component implementation

functions

Added in 1.0.0-alpha02
val functions: A2uiBasicCatalogV1.Functions

the Functions implementations

icon

Added in 1.0.0-alpha02
val icon: A2uiBasicCatalogV1.Icon

the Icon component implementation

image

Added in 1.0.0-alpha02
val image: A2uiBasicCatalogV1.Image

the Image component implementation

list

Added in 1.0.0-alpha02
val list: A2uiBasicCatalogV1.List

the List component implementation

modal

Added in 1.0.0-alpha02
val modal: A2uiBasicCatalogV1.Modal

the Modal component implementation

row

Added in 1.0.0-alpha02
val row: A2uiBasicCatalogV1.Row

the Row component implementation

slider

Added in 1.0.0-alpha02
val slider: A2uiBasicCatalogV1.Slider

the Slider component implementation

tabs

Added in 1.0.0-alpha02
val tabs: A2uiBasicCatalogV1.Tabs

the Tabs component implementation

text

Added in 1.0.0-alpha02
val text: A2uiBasicCatalogV1.Text

the Text component implementation

textField

Added in 1.0.0-alpha02
val textField: A2uiBasicCatalogV1.TextField

the TextField component implementation

themeSchema

Added in 1.0.0-alpha02
val themeSchema: A2uiSchema

The A2uiSchema defining the dynamic theme schema for this catalog.

video

Added in 1.0.0-alpha02
val video: A2uiBasicCatalogV1.Video

the Video component implementation

Extension functions

A2uiBasicCatalogV1.toA2uiCatalog

fun A2uiBasicCatalogV1.toA2uiCatalog(isInline: Boolean = false): A2uiCatalog

Converts this basic catalog into an A2uiCatalog holding the catalog definitions.

Parameters
isInline: Boolean = false

whether this catalog's schema should be serialized inline as part of the capabilities advertisement sent to the agent

Returns
A2uiCatalog

a fully initialized A2uiCatalog