androidx.wear.protolayout.types
Classes
LayoutColor |
Static or dynamic color value for layout fields. |
LayoutString |
Static or dynamic string value for layout fields. |
Top-level functions summary
TypeBuilders.StringLayoutConstraint |
@RequiresSchemaVersion(major = 1, minor = 200)Specifies layout constraints for to use for layout measurement in presence of dynamic values. |
Extension functions summary
LayoutColor |
@RequiresSchemaVersion(major = 1, minor = 200)Extension for creating a |
LayoutColor |
@RequiresSchemaVersion(major = 1, minor = 200)Extension for creating a |
TypeBuilders.StringLayoutConstraint |
@RequiresSchemaVersion(major = 1, minor = 200)Extension for creating a |
LayoutString |
@RequiresSchemaVersion(major = 1, minor = 600)Extension for creating a |
LayoutString |
@RequiresSchemaVersion(major = 1, minor = 200)Extension for creating a |
Extension properties summary
LayoutColor |
Extension for creating a |
LayoutColor |
Extension for creating a |
LayoutString |
Extension for creating a |
Top-level functions
stringLayoutConstraint
@RequiresSchemaVersion(major = 1, minor = 200)
fun stringLayoutConstraint(
longestPattern: String,
alignment: Int = TEXT_ALIGN_CENTER
): TypeBuilders.StringLayoutConstraint
Specifies layout constraints for to use for layout measurement in presence of dynamic values.
| Parameters | |
|---|---|
longestPattern: String |
the text string to use as the pattern for the (graphically) longest text that can be laid out. Used to ensure that the layout is of a known size during the layout pass. |
alignment: Int = TEXT_ALIGN_CENTER |
the alignment of the actual text within the space reserved by |
Extension functions
asLayoutColor
@RequiresSchemaVersion(major = 1, minor = 200)
fun DynamicBuilders.DynamicColor.asLayoutColor(staticArgb: @ColorInt Int): LayoutColor
Extension for creating a LayoutColor from a DynamicColor
asLayoutColor
@RequiresSchemaVersion(major = 1, minor = 200)
fun DynamicBuilders.DynamicColor.asLayoutColor(staticArgb: @ColorInt Long): LayoutColor
Extension for creating a LayoutColor from a DynamicColor
asLayoutConstraint
@RequiresSchemaVersion(major = 1, minor = 200)
fun String.asLayoutConstraint(alignment: Int = TEXT_ALIGN_CENTER): TypeBuilders.StringLayoutConstraint
Extension for creating a StringLayoutConstraint from a String. this will be used as longestPattern.
| Parameters | |
|---|---|
alignment: Int = TEXT_ALIGN_CENTER |
the alignment of the actual text within the space reserved by |
asLayoutString
@RequiresSchemaVersion(major = 1, minor = 600)
fun DynamicBuilders.DynamicString.asLayoutString(staticValue: String): LayoutString
Extension for creating a LayoutString from a DynamicString
| Parameters | |
|---|---|
staticValue: String |
the static value that can be used when the |
asLayoutString
@RequiresSchemaVersion(major = 1, minor = 200)
fun DynamicBuilders.DynamicString.asLayoutString(
staticValue: String,
layoutConstraint: TypeBuilders.StringLayoutConstraint
): LayoutString
Extension for creating a LayoutString from a DynamicString
| Parameters | |
|---|---|
staticValue: String |
the static value that can be used when the |
layoutConstraint: TypeBuilders.StringLayoutConstraint |
used to correctly measure layout Text element size and align text to ensure that the layout is of a known size during the layout pass regardless of the |
Extension properties
layoutString
val String.layoutString: LayoutString
Extension for creating a LayoutString from a String.