LayoutElementBuilders

public final class LayoutElementBuilders
extends Object

java.lang.Object
   ↳ androidx.wear.tiles.builders.LayoutElementBuilders


Builders for composable layout elements that can be combined together to create renderable UI layouts.

Summary

Nested classes

class LayoutElementBuilders.Arc

An arc container. 

class LayoutElementBuilders.ArcAdapter

A container that allows a standard LayoutElementBuilders.LayoutElement to be added to an LayoutElementBuilders.Arc

interface LayoutElementBuilders.ArcLayoutElement

Interface defining the root of all elements that can be used in an LayoutElementBuilders.Arc

class LayoutElementBuilders.ArcLine

A line that can be used in an LayoutElementBuilders.Arc and renders as a round progress bar. 

class LayoutElementBuilders.ArcSpacer

A simple spacer used to provide padding between adjacent elements in an LayoutElementBuilders.Arc

class LayoutElementBuilders.ArcText

A text element that can be used in an LayoutElementBuilders.Arc

class LayoutElementBuilders.Box

A container which stacks all of its children on top of one another. 

class LayoutElementBuilders.Column

A column of elements. 

class LayoutElementBuilders.FontStyle

The styling of a font (e.g. 

class LayoutElementBuilders.FontStyles

Font styles, currently set up to match Wear's font styling. 

class LayoutElementBuilders.Image

An image. 

class LayoutElementBuilders.Layout

A complete layout. 

interface LayoutElementBuilders.LayoutElement

Interface defining the root of all layout elements. 

class LayoutElementBuilders.Row

A row of elements. 

class LayoutElementBuilders.Spacer

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

interface LayoutElementBuilders.Span

Interface defining a single LayoutElementBuilders.Span

class LayoutElementBuilders.SpanImage

An image which can be added to a LayoutElementBuilders.Span

class LayoutElementBuilders.SpanText

A portion of text which can be added to a LayoutElementBuilders.Span

class LayoutElementBuilders.Spannable

A container of LayoutElementBuilders.Span elements. 

class LayoutElementBuilders.Text

A text string. 

Constants

int ARC_ANCHOR_CENTER

Anchor at the center of the elements.

int ARC_ANCHOR_END

Anchor at the end of the elements.

int ARC_ANCHOR_START

Anchor at the start of the elements.

int ARC_ANCHOR_UNDEFINED

Anchor position is undefined.

int CONTENT_SCALE_MODE_CROP

Content will be resized proportionally so it completely fills its bounds, and anything outside of the bounds will be cropped.

int CONTENT_SCALE_MODE_FILL_BOUNDS

Content will be resized to fill its bounds, without taking into account the aspect ratio.

int CONTENT_SCALE_MODE_FIT

Content will be scaled to fit inside its bounds, proportionally.

int CONTENT_SCALE_MODE_UNDEFINED

Content scaling is undefined.

int FONT_VARIANT_BODY

Font variant suited for body text.

int FONT_VARIANT_TITLE

Font variant suited for title text.

int FONT_VARIANT_UNDEFINED

Font variant is undefined.

int FONT_WEIGHT_BOLD

Bold font weight.

int FONT_WEIGHT_MEDIUM

Medium font weight.

int FONT_WEIGHT_NORMAL

Normal font weight.

int FONT_WEIGHT_UNDEFINED

Font weight is undefined.

int HALIGN_CENTER

Horizontally align to center.

int HALIGN_END

Horizontally align to the content end (right in LTR layouts, left in RTL layouts).

int HALIGN_LEFT

Horizontally align to the left.

int HALIGN_RIGHT

Horizontally align to the right.

int HALIGN_START

Horizontally align to the content start (left in LTR layouts, right in RTL layouts).

int HALIGN_UNDEFINED

Horizontal alignment is undefined.

int SPAN_VALIGN_BOTTOM

Align to the bottom of the line (descent of the largest text in this line).

int SPAN_VALIGN_TEXT_BASELINE

Align to the baseline of the text.

int SPAN_VALIGN_UNDEFINED

Alignment is undefined.

int TEXT_ALIGN_CENTER

Align to the center of the LayoutElementBuilders.Text element.

int TEXT_ALIGN_END

Align to the "end" of the LayoutElementBuilders.Text element (right in LTR layouts, left in RTL layouts).

int TEXT_ALIGN_START

Align to the "start" of the LayoutElementBuilders.Text element (left in LTR layouts, right in RTL layouts).

int TEXT_ALIGN_UNDEFINED

Alignment is undefined.

int TEXT_OVERFLOW_ELLIPSIZE_END

Truncate the text to fit in the LayoutElementBuilders.Text element's bounds, but add an ellipsis (i.e.

int TEXT_OVERFLOW_TRUNCATE

Truncate the text to fit inside of the LayoutElementBuilders.Text element's bounds.

int TEXT_OVERFLOW_UNDEFINED

Overflow behavior is undefined.

int VALIGN_BOTTOM

Vertically align to the bottom.

int VALIGN_CENTER

Vertically align to center.

int VALIGN_TOP

Vertically align to the top.

int VALIGN_UNDEFINED

Vertical alignment is undefined.

Inherited methods

Constants

ARC_ANCHOR_CENTER

public static final int ARC_ANCHOR_CENTER

Anchor at the center of the elements. This will cause the center of the whole set of elements added to an arc to be pinned at the given anchor_angle.

Constant Value: 2 (0x00000002)

ARC_ANCHOR_END

public static final int ARC_ANCHOR_END

Anchor at the end of the elements. This will cause the set of elements inside the arc to end at the specified anchor_angle, i.e. all elements should be to the left of anchor_angle.

Constant Value: 3 (0x00000003)

ARC_ANCHOR_START

public static final int ARC_ANCHOR_START

Anchor at the start of the elements. This will cause elements added to an arc to begin at the given anchor_angle, and sweep around to the right.

Constant Value: 1 (0x00000001)

ARC_ANCHOR_UNDEFINED

public static final int ARC_ANCHOR_UNDEFINED

Anchor position is undefined.

Constant Value: 0 (0x00000000)

CONTENT_SCALE_MODE_CROP

public static final int CONTENT_SCALE_MODE_CROP

Content will be resized proportionally so it completely fills its bounds, and anything outside of the bounds will be cropped. As an example, if a 10x5 image was going to be drawn inside a 50x50 LayoutElementBuilders.Image element, the image resource would be drawn as a 100x50 image, centered within its bounds (and with 25px cropped from both the left and right sides).

Constant Value: 2 (0x00000002)

CONTENT_SCALE_MODE_FILL_BOUNDS

public static final int CONTENT_SCALE_MODE_FILL_BOUNDS

Content will be resized to fill its bounds, without taking into account the aspect ratio. If a 10x5 image was going to be drawn inside a 50x50 LayoutElementBuilders.Image element, the image would be drawn as a 50x50 image, stretched vertically.

Constant Value: 3 (0x00000003)

CONTENT_SCALE_MODE_FIT

public static final int CONTENT_SCALE_MODE_FIT

Content will be scaled to fit inside its bounds, proportionally. As an example, If a 10x5 image was going to be drawn inside a 50x50 LayoutElementBuilders.Image element, the actual image resource would be drawn as a 50x25 image, centered within the 50x50 bounds.

Constant Value: 1 (0x00000001)

CONTENT_SCALE_MODE_UNDEFINED

public static final int CONTENT_SCALE_MODE_UNDEFINED

Content scaling is undefined.

Constant Value: 0 (0x00000000)

FONT_VARIANT_BODY

public static final int FONT_VARIANT_BODY

Font variant suited for body text.

Constant Value: 2 (0x00000002)

FONT_VARIANT_TITLE

public static final int FONT_VARIANT_TITLE

Font variant suited for title text.

Constant Value: 1 (0x00000001)

FONT_VARIANT_UNDEFINED

public static final int FONT_VARIANT_UNDEFINED

Font variant is undefined.

Constant Value: 0 (0x00000000)

FONT_WEIGHT_BOLD

public static final int FONT_WEIGHT_BOLD

Bold font weight.

Constant Value: 700 (0x000002bc)

FONT_WEIGHT_MEDIUM

public static final int FONT_WEIGHT_MEDIUM

Medium font weight.

Constant Value: 500 (0x000001f4)

FONT_WEIGHT_NORMAL

public static final int FONT_WEIGHT_NORMAL

Normal font weight.

Constant Value: 400 (0x00000190)

FONT_WEIGHT_UNDEFINED

public static final int FONT_WEIGHT_UNDEFINED

Font weight is undefined.

Constant Value: 0 (0x00000000)

HALIGN_CENTER

public static final int HALIGN_CENTER

Horizontally align to center.

Constant Value: 2 (0x00000002)

HALIGN_END

public static final int HALIGN_END

Horizontally align to the content end (right in LTR layouts, left in RTL layouts).

Constant Value: 5 (0x00000005)

HALIGN_LEFT

public static final int HALIGN_LEFT

Horizontally align to the left.

Constant Value: 1 (0x00000001)

HALIGN_RIGHT

public static final int HALIGN_RIGHT

Horizontally align to the right.

Constant Value: 3 (0x00000003)

HALIGN_START

public static final int HALIGN_START

Horizontally align to the content start (left in LTR layouts, right in RTL layouts).

Constant Value: 4 (0x00000004)

HALIGN_UNDEFINED

public static final int HALIGN_UNDEFINED

Horizontal alignment is undefined.

Constant Value: 0 (0x00000000)

SPAN_VALIGN_BOTTOM

public static final int SPAN_VALIGN_BOTTOM

Align to the bottom of the line (descent of the largest text in this line). If there is no text in the line containing this image, this will align to the bottom of the line, where the line height is defined as the height of the largest image in the line.

Constant Value: 1 (0x00000001)

SPAN_VALIGN_TEXT_BASELINE

public static final int SPAN_VALIGN_TEXT_BASELINE

Align to the baseline of the text. Note that if the line in the LayoutElementBuilders.Spannable which contains this image does not contain any text, the effects of using this alignment are undefined.

Constant Value: 2 (0x00000002)

SPAN_VALIGN_UNDEFINED

public static final int SPAN_VALIGN_UNDEFINED

Alignment is undefined.

Constant Value: 0 (0x00000000)

TEXT_ALIGN_CENTER

public static final int TEXT_ALIGN_CENTER

Align to the center of the LayoutElementBuilders.Text element.

Constant Value: 2 (0x00000002)

TEXT_ALIGN_END

public static final int TEXT_ALIGN_END

Align to the "end" of the LayoutElementBuilders.Text element (right in LTR layouts, left in RTL layouts).

Constant Value: 3 (0x00000003)

TEXT_ALIGN_START

public static final int TEXT_ALIGN_START

Align to the "start" of the LayoutElementBuilders.Text element (left in LTR layouts, right in RTL layouts).

Constant Value: 1 (0x00000001)

TEXT_ALIGN_UNDEFINED

public static final int TEXT_ALIGN_UNDEFINED

Alignment is undefined.

Constant Value: 0 (0x00000000)

TEXT_OVERFLOW_ELLIPSIZE_END

public static final int TEXT_OVERFLOW_ELLIPSIZE_END

Truncate the text to fit in the LayoutElementBuilders.Text element's bounds, but add an ellipsis (i.e. ...) to the end of the text if it has been truncated.

Constant Value: 2 (0x00000002)

TEXT_OVERFLOW_TRUNCATE

public static final int TEXT_OVERFLOW_TRUNCATE

Truncate the text to fit inside of the LayoutElementBuilders.Text element's bounds. If text is truncated, it will be truncated on a word boundary.

Constant Value: 1 (0x00000001)

TEXT_OVERFLOW_UNDEFINED

public static final int TEXT_OVERFLOW_UNDEFINED

Overflow behavior is undefined.

Constant Value: 0 (0x00000000)

VALIGN_BOTTOM

public static final int VALIGN_BOTTOM

Vertically align to the bottom.

Constant Value: 3 (0x00000003)

VALIGN_CENTER

public static final int VALIGN_CENTER

Vertically align to center.

Constant Value: 2 (0x00000002)

VALIGN_TOP

public static final int VALIGN_TOP

Vertically align to the top.

Constant Value: 1 (0x00000001)

VALIGN_UNDEFINED

public static final int VALIGN_UNDEFINED

Vertical alignment is undefined.

Constant Value: 0 (0x00000000)