public final 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(@NonNull String staticValue)

Creates an instance for a static String value.

@RequiresSchemaVersion(major = 1, minor = 200)
LayoutString(
    @NonNull String staticValue,
    @NonNull DynamicBuilders.DynamicString dynamicValue,
    @NonNull TypeBuilders.StringLayoutConstraint layoutConstraint
)

Creates an instance for a DynamicString value with a static value fallback and a set of layout constraints for the dynamic value.

Public methods

boolean
equals(Object other)
final DynamicBuilders.DynamicString

The dynamic value.

final TypeBuilders.StringLayoutConstraint

When dynamicValue is used, this allows correctly measuring layout Text element size and aligning text to ensure that the layout is of a known size during the layout pass regardless of the dynamicValue String.

final @NonNull String

The static value.

int
@NonNull String

Public constructors

LayoutString

Added in 1.3.0-alpha05
public LayoutString(@NonNull String staticValue)

Creates an instance for a static String value.

LayoutString

Added in 1.3.0-alpha05
@RequiresSchemaVersion(major = 1, minor = 200)
public LayoutString(
    @NonNull String staticValue,
    @NonNull DynamicBuilders.DynamicString dynamicValue,
    @NonNull TypeBuilders.StringLayoutConstraint layoutConstraint
)

Creates an instance for a DynamicString value with a static value fallback and a set of layout constraints for the dynamic value.

Parameters
@NonNull String staticValue

the static value that can be used when the dynamicValue can't be resolved.

@NonNull DynamicBuilders.DynamicString dynamicValue

the dynamic value. If this value can be resolved, the staticValue won't be used.

@NonNull TypeBuilders.StringLayoutConstraint layoutConstraint

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 dynamicValue String.

Public methods

equals

public boolean equals(Object other)

getDynamicValue

Added in 1.3.0-alpha05
public final DynamicBuilders.DynamicString getDynamicValue()

The dynamic value. If this can't be resolved staticValue will be used during rendering.

getLayoutConstraint

Added in 1.3.0-alpha05
public final TypeBuilders.StringLayoutConstraint getLayoutConstraint()

When dynamicValue is used, this allows correctly measuring layout Text element size and aligning text to ensure that the layout is of a known size during the layout pass regardless of the dynamicValue String.

getStaticValue

Added in 1.3.0-alpha05
public final @NonNull String getStaticValue()

The static value. If dynamicValue is not null this will be used as the default value for when dynamicValue can't be resolved.

hashCode

public int hashCode()

toString

public @NonNull String toString()