public interface

LayoutElementProto.TextOrBuilder

 androidx.wear.protolayout.proto.LayoutElementProto.TextOrBuilder

Subclasses:

LayoutElementProto.Text, LayoutElementProto.Text.Builder

Summary

Methods
public LayoutElementProto.AndroidTextStylegetAndroidTextStyle()

 An Android platform specific text style configuration options for styling
 and compatibility.

public LayoutElementProto.FontStylegetFontStyle()

 The style of font to use (size, bold etc).

public DimensionProto.SpPropgetLineHeight()

 The explicit height between lines of text.

public LayoutElementProto.MarqueeParametersgetMarqueeParameters()

 Parameters for Marquee animation.

public TypesProto.Int32PropgetMaxLines()

 The maximum number of lines that can be represented by the Text element.

public ModifiersProto.ModifiersgetModifiers()

 Modifiers for this element.

public AlignmentProto.TextAlignmentPropgetMultilineAlignment()

 Alignment of the text within its bounds.

public LayoutElementProto.TextOverflowPropgetOverflow()

 How to handle text which overflows the bound of the Text element.

public TypesProto.StringPropgetText()

 The text to render.

public booleanhasAndroidTextStyle()

 An Android platform specific text style configuration options for styling
 and compatibility.

public booleanhasFontStyle()

 The style of font to use (size, bold etc).

public booleanhasLineHeight()

 The explicit height between lines of text.

public booleanhasMarqueeParameters()

 Parameters for Marquee animation.

public booleanhasMaxLines()

 The maximum number of lines that can be represented by the Text element.

public booleanhasModifiers()

 Modifiers for this element.

public booleanhasMultilineAlignment()

 Alignment of the text within its bounds.

public booleanhasOverflow()

 How to handle text which overflows the bound of the Text element.

public booleanhasText()

 The text to render.

Methods

public boolean hasText()

 The text to render.

 While this field is statically accessible from 1.0, it's only bindable
 since version 1.2 and renderers supporting version 1.2 will use the dynamic
 value (if set).

 When using a dynamic value, make sure to specify the bounding constraints
 for the affected layout element through {@code
 setLayoutConstraintsForDynamicText(StringLayoutConstraint)} otherwise
 {@code build()} fails.
 
.androidx.wear.protolayout.proto.StringProp text = 1;

Returns:

Whether the text field is set.

public TypesProto.StringProp getText()

 The text to render.

 While this field is statically accessible from 1.0, it's only bindable
 since version 1.2 and renderers supporting version 1.2 will use the dynamic
 value (if set).

 When using a dynamic value, make sure to specify the bounding constraints
 for the affected layout element through {@code
 setLayoutConstraintsForDynamicText(StringLayoutConstraint)} otherwise
 {@code build()} fails.
 
.androidx.wear.protolayout.proto.StringProp text = 1;

Returns:

The text.

public boolean hasFontStyle()

 The style of font to use (size, bold etc). If not specified, defaults to
 the platform's default body font.
 
.androidx.wear.protolayout.proto.FontStyle font_style = 2;

Returns:

Whether the fontStyle field is set.

public LayoutElementProto.FontStyle getFontStyle()

 The style of font to use (size, bold etc). If not specified, defaults to
 the platform's default body font.
 
.androidx.wear.protolayout.proto.FontStyle font_style = 2;

Returns:

The fontStyle.

public boolean hasModifiers()

 Modifiers for this element.
 
.androidx.wear.protolayout.proto.Modifiers modifiers = 3;

Returns:

Whether the modifiers field is set.

public ModifiersProto.Modifiers getModifiers()

 Modifiers for this element.
 
.androidx.wear.protolayout.proto.Modifiers modifiers = 3;

Returns:

The modifiers.

public boolean hasMaxLines()

 The maximum number of lines that can be represented by the Text element.
 If not defined, the Text element will be treated as a single-line element.
 
.androidx.wear.protolayout.proto.Int32Prop max_lines = 4;

Returns:

Whether the maxLines field is set.

public TypesProto.Int32Prop getMaxLines()

 The maximum number of lines that can be represented by the Text element.
 If not defined, the Text element will be treated as a single-line element.
 
.androidx.wear.protolayout.proto.Int32Prop max_lines = 4;

Returns:

The maxLines.

public boolean hasMultilineAlignment()

 Alignment of the text within its bounds. Note that a 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). For multi-line text,
 however, this will set the alignment of lines relative to the Text element
 bounds. If not defined, defaults to TEXT_ALIGN_CENTER.
 
.androidx.wear.protolayout.proto.TextAlignmentProp multiline_alignment = 5;

Returns:

Whether the multilineAlignment field is set.

public AlignmentProto.TextAlignmentProp getMultilineAlignment()

 Alignment of the text within its bounds. Note that a 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). For multi-line text,
 however, this will set the alignment of lines relative to the Text element
 bounds. If not defined, defaults to TEXT_ALIGN_CENTER.
 
.androidx.wear.protolayout.proto.TextAlignmentProp multiline_alignment = 5;

Returns:

The multilineAlignment.

public boolean hasOverflow()

 How to handle text which overflows the bound of the Text element.
 A 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.
 
.androidx.wear.protolayout.proto.TextOverflowProp overflow = 6;

Returns:

Whether the overflow field is set.

 How to handle text which overflows the bound of the Text element.
 A 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.
 
.androidx.wear.protolayout.proto.TextOverflowProp overflow = 6;

Returns:

The overflow.

public boolean hasMarqueeParameters()

 Parameters for Marquee animation. Only applies when overflow is
 TEXT_OVERFLOW_MARQUEE.
 
.androidx.wear.protolayout.proto.MarqueeParameters marquee_parameters = 9;

Returns:

Whether the marqueeParameters field is set.

public LayoutElementProto.MarqueeParameters getMarqueeParameters()

 Parameters for Marquee animation. Only applies when overflow is
 TEXT_OVERFLOW_MARQUEE.
 
.androidx.wear.protolayout.proto.MarqueeParameters marquee_parameters = 9;

Returns:

The marqueeParameters.

public boolean hasLineHeight()

 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.
 
.androidx.wear.protolayout.proto.SpProp line_height = 7;

Returns:

Whether the lineHeight field is set.

public DimensionProto.SpProp getLineHeight()

 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.
 
.androidx.wear.protolayout.proto.SpProp line_height = 7;

Returns:

The lineHeight.

public boolean hasAndroidTextStyle()

 An Android platform specific text style configuration options for styling
 and compatibility.
 
.androidx.wear.protolayout.proto.AndroidTextStyle android_text_style = 8;

Returns:

Whether the androidTextStyle field is set.

public LayoutElementProto.AndroidTextStyle getAndroidTextStyle()

 An Android platform specific text style configuration options for styling
 and compatibility.
 
.androidx.wear.protolayout.proto.AndroidTextStyle android_text_style = 8;

Returns:

The androidTextStyle.