# androidx.wear.protolayout.layout

*** ** * ** ***

## Top-level functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.AndroidImageResourceByResId` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#androidImageResource(kotlin.Int)(resourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Builds image resource that maps to an Android drawable by the given resource ID. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Text` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#basicText(androidx.wear.protolayout.types.LayoutString,androidx.wear.protolayout.LayoutElementBuilders.FontStyle,androidx.wear.protolayout.modifiers.LayoutModifier,kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Float)( text: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutString, fontStyle: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.FontStyle?, modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier?, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, alignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, overflow: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, lineHeight: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 2) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Builds a text string. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Box` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#box(kotlin.Array,androidx.wear.protolayout.DimensionBuilders.ContainerDimension,androidx.wear.protolayout.DimensionBuilders.ContainerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,kotlin.Int,kotlin.Int)( vararg contents: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement, width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension?, height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension?, modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier?, horizontalAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, verticalAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Creates a container which stacks all of its children on top of one another. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#column(kotlin.Array,androidx.wear.protolayout.DimensionBuilders.ContainerDimension,androidx.wear.protolayout.DimensionBuilders.ContainerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,kotlin.Int)( vararg contents: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement, width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension?, height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension?, modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier?, horizontalAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Creates a column of elements. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.FontStyle` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#fontStyle(kotlin.Float,kotlin.Boolean,kotlin.Boolean,androidx.wear.protolayout.types.LayoutColor,kotlin.Int,kotlin.Float,kotlin.collections.List,kotlin.collections.List,kotlin.collections.List)( size: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 2) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, italic: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, underline: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, color: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor?, weight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, letterSpacingEm: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, @https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) additionalSizesSp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, @https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) settings: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.FontSetting>, @https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) preferredFontFamilies: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html> )` Builds the styling of a font (e.g. font size, and metrics). |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.ImageResource` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#imageResource(androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId,androidx.wear.protolayout.ResourceBuilders.InlineImageResource,androidx.wear.protolayout.ResourceBuilders.AndroidLottieResourceByResId)( androidImage: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.AndroidImageResourceByResId?, inlineImage: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.InlineImageResource?, lottie: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.AndroidLottieResourceByResId? )` Builds a resource object for the image, based on the given resources types. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.InlineImageResource` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#inlineImageResource(kotlin.ByteArray,kotlin.Int,kotlin.Int)( compressedBytes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html, widthPx: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, heightPx: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Builds image resource that contains the compressed image data extracted from the raw image data. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.InlineImageResource` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#inlineImageResource(kotlin.ByteArray,kotlin.Int,kotlin.Int,kotlin.Int)( pixelBuffer: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html, format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, widthPx: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, heightPx: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Builds image resource that contains the pixel buffer in the specified format of the given byte array data. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.AndroidLottieResourceByResId` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#lottieResource(kotlin.Int,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat,kotlin.collections.List)( @https://developer.android.com/reference/kotlin/androidx/annotation/RawRes rawResourceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, progress: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat, properties: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.LottieProperty> )` Builds Lottie resource that is read from a raw Android resource ID and can be played via progress. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.AndroidLottieResourceByResId` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#lottieResource(kotlin.Int,androidx.wear.protolayout.TriggerBuilders.Trigger,kotlin.collections.List)( @https://developer.android.com/reference/kotlin/androidx/annotation/RawRes rawResourceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, startTrigger: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TriggerBuilders.Trigger?, properties: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.LottieProperty> )` Builds Lottie resource that is read from a raw Android resource ID and can be played via starting trigger. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Row` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#row(kotlin.Array,androidx.wear.protolayout.DimensionBuilders.ContainerDimension,androidx.wear.protolayout.DimensionBuilders.ContainerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,kotlin.Int)( vararg contents: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement, width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension?, height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension?, modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier?, verticalAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Creates a row of elements. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Spacer` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#spacer(androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint,androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint)( width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.SpacerDimension?, height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.SpacerDimension?, modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier?, @https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) horizontalLayoutConstraint: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.HorizontalLayoutConstraint?, @https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) verticalLayoutConstraint: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.VerticalLayoutConstraint? )` Creates a simple spacer, typically used to provide padding between adjacent elements. |

## Extension functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Image` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ProtoLayoutScope.https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#(androidx.wear.protolayout.ProtoLayoutScope).basicImage(androidx.wear.protolayout.ResourceBuilders.ImageResource,androidx.wear.protolayout.DimensionBuilders.ImageDimension,androidx.wear.protolayout.DimensionBuilders.ImageDimension,kotlin.String,androidx.wear.protolayout.modifiers.LayoutModifier,kotlin.Int,androidx.wear.protolayout.types.LayoutColor)( resource: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.ImageResource, width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ImageDimension, height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ImageDimension, protoLayoutResourceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier?, contentScaleMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, tintColor: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor? )` Builds an image from the given resources. |

## Top-level functions

### androidImageResource

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Image.kt+function:androidImageResource) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
fun androidImageResource(resourceId: @DrawableRes Int): ResourceBuilders.AndroidImageResourceByResId
```

Builds image resource that maps to an Android drawable by the given resource ID.

| Parameters |
|---|---|
| `resourceId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The drawable resource ID to map this image |

### basicText

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Text.kt+function:basicText) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
fun basicText(
    text: LayoutString,
    fontStyle: LayoutElementBuilders.FontStyle? = null,
    modifier: LayoutModifier? = null,
    maxLines: Int = 0,
    alignment: Int = TEXT_ALIGN_UNDEFINED,
    overflow: Int = TEXT_OVERFLOW_UNDEFINED,
    lineHeight: @Dimension(unit = 2) Float = Float.NaN
): LayoutElementBuilders.Text
```

Builds a text string.

| Parameters |
|---|---|
| `text: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutString` | The text to render. |
| `fontStyle: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.FontStyle? = null` | The style of font to use (size, bold etc). If not specified, defaults to the platform's default body font. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier? = null` | Modifiers to set to this element. |
| `maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | The maximum number of lines that can be represented by the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Text` element. If not defined, the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Text` element will be treated as a single-line element. |
| `alignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = TEXT_ALIGN_UNDEFINED` | Alignment of the text within its bounds. Note that a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Text` element will size itself to wrap its contents, so this option is meaningless for single-line text (for that, use alignment of the outer container), unless this text overflows. For multi-line text, however, this will set the alignment of lines relative to the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Text` element bounds. If not defined, defaults to TEXT_ALIGN_CENTER. |
| `overflow: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = TEXT_OVERFLOW_UNDEFINED` | How to handle text which overflows the bound of the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Text` element. A `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Text` element will grow as large as possible inside its parent container (while still respecting max_lines); if it cannot grow large enough to render all of its text, the text which cannot fit inside its container will be truncated. If not defined, defaults to TEXT_OVERFLOW_TRUNCATE. |
| `lineHeight: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 2) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | The explicit height between lines of text. This is equivalent to the vertical distance between subsequent baselines. If not specified, defaults the font's recommended interline spacing. |

### box

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Container.kt+function:box)

```
fun box(
    vararg contents: LayoutElementBuilders.LayoutElement,
    width: DimensionBuilders.ContainerDimension? = null,
    height: DimensionBuilders.ContainerDimension? = null,
    modifier: LayoutModifier? = null,
    horizontalAlignment: Int = HORIZONTAL_ALIGN_UNDEFINED,
    verticalAlignment: Int = VERTICAL_ALIGN_UNDEFINED
): LayoutElementBuilders.Box
```

Creates a container which stacks all of its children on top of one another. This also allows to add a background color, or to have a border around them with some padding.

| Parameters |
|---|---|
| `vararg contents: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement` | The list of child elements to place inside this container. |
| `width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension? = null` | The width of the box. Defaults to wrap. |
| `height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension? = null` | The height of the box. Defaults to wrap. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier? = null` | Modifiers to set to this element |
| `horizontalAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = HORIZONTAL_ALIGN_UNDEFINED` | The horizontal alignment of the element inside this box. Defaults to center aligned. |
| `verticalAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = VERTICAL_ALIGN_UNDEFINED` | The vertical alignment of the element inside this box. Defaults to center aligned. |

### column

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Container.kt+function:column)

```
fun column(
    vararg contents: LayoutElementBuilders.LayoutElement,
    width: DimensionBuilders.ContainerDimension? = null,
    height: DimensionBuilders.ContainerDimension? = null,
    modifier: LayoutModifier? = null,
    horizontalAlignment: Int = HORIZONTAL_ALIGN_UNDEFINED
): LayoutElementBuilders.Column
```

Creates a column of elements. Each child element will be laid out vertically, one after another (i.e. stacking down). This element will size itself to the smallest size required to hold all of its children (e.g. if it contains three elements sized 10x10, 20x20 and 30x30, the resulting column will be 30x60).

If specified, horizontal_alignment can be used to control the gravity inside the container, affecting the horizontal placement of children whose width are smaller than the resulting column width.

| Parameters |
|---|---|
| `vararg contents: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement` | The list of child elements to place inside this container. |
| `width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension? = null` | The width of the box. Defaults to wrap. |
| `height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension? = null` | The height of the box. Defaults to wrap. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier? = null` | Modifiers to set to this element |
| `horizontalAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = HORIZONTAL_ALIGN_UNDEFINED` | The horizontal alignment of the element inside this box. Defaults to center aligned. |

### fontStyle

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Text.kt+function:fontStyle)

```
fun fontStyle(
    size: @Dimension(unit = 2) Float = 0.0f,
    italic: Boolean = false,
    underline: Boolean = false,
    color: LayoutColor? = null,
    weight: Int = FONT_WEIGHT_UNDEFINED,
    letterSpacingEm: Float = Float.NaN,
    @RequiresSchemaVersion(major = 1, minor = 300) additionalSizesSp: List<Float> = emptyList(),
    @RequiresSchemaVersion(major = 1, minor = 400) settings: List<LayoutElementBuilders.FontSetting> = emptyList(),
    @RequiresSchemaVersion(major = 1, minor = 400) preferredFontFamilies: List<String> = emptyList()
): LayoutElementBuilders.FontStyle
```

Builds the styling of a font (e.g. font size, and metrics).

| Parameters |
|---|---|
| `size: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 2) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | The size of the font, in scaled pixels (sp). If not specified, defaults to the size of the system's "body" font. |
| `italic: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Whether the text should be rendered in a italic typeface. |
| `underline: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Whether the text should be rendered with an underline. |
| `color: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor? = null` | The text color. If not defined, defaults to white. |
| `weight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = FONT_WEIGHT_UNDEFINED` | The weight of the font. If the provided value is not supported on a platform, the nearest supported value will be used. If not defined, or when set to an invalid value, defaults to "normal". |
| `letterSpacingEm: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | The text letter-spacing. Positive numbers increase the space between letters while negative numbers tighten the space. If not specified, defaults to 0. |
| `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) additionalSizesSp: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = emptyList()` | when this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.FontStyle` is applied to a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Text` element with static text, the text size will be automatically picked from the provided sizes to try to perfectly fit within its parent bounds. In other words, the largest size from the specified preset sizes that can fit the most text within the parent bounds will be used. |
| `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) settings: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.FontSetting> = emptyList()` | The collection of font settings to be applied. If more than one Setting with the same axis tag is specified, the first one will be used. Supported settings depend on the font used by the system and the renderer version. However, if using `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.FontSetting#weight(int)` axis with a value higher than `500`, consider adding a fallback `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#fontStyle(kotlin.Float,kotlin.Boolean,kotlin.Boolean,androidx.wear.protolayout.types.LayoutColor,kotlin.Int,kotlin.Float,kotlin.collections.List,kotlin.collections.List,kotlin.collections.List)` parameter as `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders#FONT_WEIGHT_MEDIUM()` or `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders#FONT_WEIGHT_BOLD()` to avoid text looking too thin on fonts that don't support weight axis. |
| `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) preferredFontFamilies: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html> = emptyList()` | is the ordered list of font families to pick from for this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.FontStyle`. If the given font family is not available on a device, the fallback values will be attempted to use, in order in which they are given. Note that support for font family customization is dependent on the target platform. |

### imageResource

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Image.kt+function:imageResource) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
fun imageResource(
    androidImage: ResourceBuilders.AndroidImageResourceByResId? = null,
    inlineImage: ResourceBuilders.InlineImageResource? = null,
    lottie: ResourceBuilders.AndroidLottieResourceByResId? = null
): ResourceBuilders.ImageResource
```

Builds a resource object for the image, based on the given resources types. This can hold multiple underlying resource types, which the underlying renderer will pick according to what it is supported in its version and what it thinks is appropriate.

It is recommended to use this inside the APIs for the automatic resource registration, such as `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#(androidx.wear.protolayout.ProtoLayoutScope).basicImage(androidx.wear.protolayout.ResourceBuilders.ImageResource,androidx.wear.protolayout.DimensionBuilders.ImageDimension,androidx.wear.protolayout.DimensionBuilders.ImageDimension,kotlin.String,androidx.wear.protolayout.modifiers.LayoutModifier,kotlin.Int,androidx.wear.protolayout.types.LayoutColor)`.

| Parameters |
|---|---|
| `androidImage: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.AndroidImageResourceByResId? = null` | The image resource that maps to an Android drawable by resource ID |
| `inlineImage: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.InlineImageResource? = null` | The image resource that contains the image data inline |
| `lottie: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.AndroidLottieResourceByResId? = null` | The Lottie resource that is read from a raw Android resource ID |

### inlineImageResource

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Image.kt+function:inlineImageResource) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
fun inlineImageResource(
    compressedBytes: ByteArray,
    widthPx: @Dimension(unit = 1) Int,
    heightPx: @Dimension(unit = 1) Int
): ResourceBuilders.InlineImageResource
```

Builds image resource that contains the compressed image data extracted from the raw image data.

This data shouldn't be in any format. If the image data bytes are formatted use `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#inlineImageResource(kotlin.ByteArray,kotlin.Int,kotlin.Int)` with `(ByteArray, Int, Int, Int)`.

| Parameters |
|---|---|
| `compressedBytes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | The byte array representing the image |
| `widthPx: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The native width of the image, in pixels. |
| `heightPx: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The native height of the image, in pixels. |

### inlineImageResource

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Image.kt+function:inlineImageResource) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
fun inlineImageResource(
    pixelBuffer: ByteArray,
    format: Int,
    widthPx: @Dimension(unit = 1) Int,
    heightPx: @Dimension(unit = 1) Int
): ResourceBuilders.InlineImageResource
```

Builds image resource that contains the pixel buffer in the specified format of the given byte array data.

| Parameters |
|---|---|
| `pixelBuffer: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | The byte array representing the image |
| `format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The format of the byte array data representing the image. This should be specific format of `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders#IMAGE_FORMAT_RGB_565()` or `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders#IMAGE_FORMAT_ARGB_8888()`. If compressed image data is used, then `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#inlineImageResource(kotlin.ByteArray,kotlin.Int,kotlin.Int,kotlin.Int)` with `(ByteArray, Int, Int)` should be used, without specified format. |
| `widthPx: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The native width of the image, in pixels. |
| `heightPx: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The native height of the image, in pixels. |

### lottieResource

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Image.kt+function:lottieResource)

```
fun lottieResource(
    @RawRes rawResourceId: Int,
    progress: DynamicBuilders.DynamicFloat,
    properties: List<ResourceBuilders.LottieProperty> = emptyList()
): ResourceBuilders.AndroidLottieResourceByResId
```

Builds Lottie resource that is read from a raw Android resource ID and can be played via progress.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/RawRes rawResourceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The raw resource ID to map this Lottie |
| `progress: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat` | The `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat`, normally transformed from certain states with the data binding pipeline to control the progress of the animation. Its value is required to fall in the range of 0.0, 1.0. Any values outside this range would be clamped. |
| `properties: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.LottieProperty> = emptyList()` | The list of properties to customize Lottie further |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the number of properties is larger than AndroidLottieResourceByResId.getMaxPropertiesCount() |

### lottieResource

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Image.kt+function:lottieResource)

```
fun lottieResource(
    @RawRes rawResourceId: Int,
    startTrigger: TriggerBuilders.Trigger? = null,
    properties: List<ResourceBuilders.LottieProperty> = emptyList()
): ResourceBuilders.AndroidLottieResourceByResId
```

Builds Lottie resource that is read from a raw Android resource ID and can be played via starting trigger.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/RawRes rawResourceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The raw resource ID to map this Lottie |
| `startTrigger: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TriggerBuilders.Trigger? = null` | The trigger to start the animation. If not set, animation will be played on layout load |
| `properties: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.LottieProperty> = emptyList()` | The list of properties to customize Lottie further |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the number of properties is larger than AndroidLottieResourceByResId.getMaxPropertiesCount() |

### row

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Container.kt+function:row)

```
fun row(
    vararg contents: LayoutElementBuilders.LayoutElement,
    width: DimensionBuilders.ContainerDimension? = null,
    height: DimensionBuilders.ContainerDimension? = null,
    modifier: LayoutModifier? = null,
    verticalAlignment: Int = VERTICAL_ALIGN_UNDEFINED
): LayoutElementBuilders.Row
```

Creates a row of elements. Each child will be laid out horizontally, one after another (i.e. stacking to the right). This element will size itself to the smallest size required to hold all of its children (e.g. if it contains three elements sized 10x10, 20x20 and 30x30, the resulting row will be 60x30).

If specified, `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#row(kotlin.Array,androidx.wear.protolayout.DimensionBuilders.ContainerDimension,androidx.wear.protolayout.DimensionBuilders.ContainerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,kotlin.Int)` can be used to control the gravity inside the container, affecting the vertical placement of children whose width are smaller than the resulting row height.

| Parameters |
|---|---|
| `vararg contents: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement` | The list of child elements to place inside this container. |
| `width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension? = null` | The width of the box. Defaults to wrap. |
| `height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension? = null` | The height of the box. Defaults to wrap. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier? = null` | Modifiers to set to this element |
| `verticalAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = VERTICAL_ALIGN_UNDEFINED` | The vertical alignment of the element inside this box. Defaults to center aligned. |

### spacer

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Container.kt+function:spacer) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
fun spacer(
    width: DimensionBuilders.SpacerDimension? = null,
    height: DimensionBuilders.SpacerDimension? = null,
    modifier: LayoutModifier? = null,
    @RequiresSchemaVersion(major = 1, minor = 200) horizontalLayoutConstraint: DimensionBuilders.HorizontalLayoutConstraint? = null,
    @RequiresSchemaVersion(major = 1, minor = 200) verticalLayoutConstraint: DimensionBuilders.VerticalLayoutConstraint? = null
): LayoutElementBuilders.Spacer
```

Creates a simple spacer, typically used to provide padding between adjacent elements.

| Parameters |
|---|---|
| `width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.SpacerDimension? = null` | The width of the box. Defaults to wrap. |
| `height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.SpacerDimension? = null` | The height of the box. Defaults to wrap. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier? = null` | Modifiers to set to this element |
| `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) horizontalLayoutConstraint: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.HorizontalLayoutConstraint? = null` | The bounding constraints for the layout affected by the dynamic value from `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#spacer(androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint,androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint)`. If the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.SpacerDimension` for `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#spacer(androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint,androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint)` does not have a dynamic value, this will be ignored. |
| `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) verticalLayoutConstraint: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.VerticalLayoutConstraint? = null` | The bounding constraints for the layout affected by the dynamic value from `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#spacer(androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint,androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint)`. If the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.SpacerDimension` for `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/layout/package-summary#spacer(androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.DimensionBuilders.SpacerDimension,androidx.wear.protolayout.modifiers.LayoutModifier,androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint,androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint)` does not have a dynamic value, this will be ignored. |

## Extension functions

### ProtoLayoutScope.basicImage

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/layout/Image.kt+function:basicImage) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
fun ProtoLayoutScope.basicImage(
    resource: ResourceBuilders.ImageResource,
    width: DimensionBuilders.ImageDimension,
    height: DimensionBuilders.ImageDimension,
    protoLayoutResourceId: String? = null,
    modifier: LayoutModifier? = null,
    contentScaleMode: Int = CONTENT_SCALE_MODE_UNDEFINED,
    tintColor: LayoutColor? = null
): LayoutElementBuilders.Image
```

Builds an image from the given resources.

| Parameters |
|---|---|
| `resource: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ResourceBuilders.ImageResource` | An Image resource, used in the layout in the place of this element |
| `width: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ImageDimension` | The width of the image |
| `height: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ImageDimension` | The height of the image |
| `protoLayoutResourceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | The optional String ID for the resource. This is optional as it has a default value assigned by the automatic resource registration, but can be used to override it if desired to mark the resource with readable ID. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/modifiers/LayoutModifier? = null` | Modifiers to set to this element |
| `contentScaleMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = CONTENT_SCALE_MODE_UNDEFINED` | Defines how the content which does not match the dimensions of its bounds (e.g. an image resource being drawn inside an Image) will be resized to fit its bounds |
| `tintColor: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor? = null` | The tint color to apply to the image |