LayoutString
class LayoutString
Static or dynamic string value for layout fields.
This can be used on layout string fields with data binding support.
Summary
Public constructors |
|---|
LayoutString(staticValue: String)Creates an instance for a static String value. |
@RequiresSchemaVersion(major = 1, minor = 600)Creates an instance for a |
@RequiresSchemaVersion(major = 1, minor = 200)Creates an instance for a |
Public properties |
|
|---|---|
DynamicBuilders.DynamicString? |
The dynamic value. |
TypeBuilders.StringLayoutConstraint? |
When |
String |
The static value. |
Public constructors
LayoutString
LayoutString(staticValue: String)
Creates an instance for a static String value.
LayoutString
@RequiresSchemaVersion(major = 1, minor = 600)
LayoutString(
staticValue: String,
dynamicValue: DynamicBuilders.DynamicString
)
Creates an instance for a DynamicString value with a static value fallback. The text element will size itself to the content of the dynamicValue, as no layoutConstraint is specified.
| Parameters | |
|---|---|
staticValue: String |
the static value that can be used when the |
dynamicValue: DynamicBuilders.DynamicString |
the dynamic value. If this value can be resolved, the |
LayoutString
@RequiresSchemaVersion(major = 1, minor = 200)
LayoutString(
staticValue: String,
dynamicValue: DynamicBuilders.DynamicString,
layoutConstraint: TypeBuilders.StringLayoutConstraint
)
Creates an instance for a DynamicString value with a static value fallback and a set of layout constraints for the dynamic value.
| Parameters | |
|---|---|
staticValue: String |
the static value that can be used when the |
dynamicValue: DynamicBuilders.DynamicString |
the dynamic value. If this value can be resolved, 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 |
Public functions
Public properties
dynamicValue
val dynamicValue: DynamicBuilders.DynamicString?
The dynamic value. If this can't be resolved staticValue will be used during rendering.
layoutConstraint
val layoutConstraint: TypeBuilders.StringLayoutConstraint?
When dynamicValue is used, layoutConstraint ensures that the text element has a known fixed size during the layout pass, independently of the actual dynamicValue String. If not set, the text element will size itself to the content of the dynamicValue.
staticValue
val staticValue: String
The static value. If dynamicValue is not null this will be used as the default value for when dynamicValue can't be resolved.