{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

LineHeightStyle

public final class LineHeightStyle


The configuration for line height such as alignment of the line in the provided line height, whether to apply additional space as a result of line height to top of first line top and bottom of last line.

The configuration is applied only when a line height is defined on the text.

trim feature is available only when PlatformParagraphStyle.includeFontPadding is false.

Please check Trim and Alignment for more description.

Summary

Nested types

value public final class LineHeightStyle.Alignment

Defines how to align the line in the space provided by the line height.

public static class LineHeightStyle.Companion
value public final class LineHeightStyle.Trim

Defines whether the space that would be added to the top of first line, and bottom of the last line should be trimmed or not.

public static class LineHeightStyle.Trim.Companion

Public constructors

Public methods

boolean
equals(Object other)
final @NonNull LineHeightStyle.Alignment

defines how to align the line in the space provided by the line height.

final @NonNull LineHeightStyle.Trim

defines whether the space that would be added to the top of first line, and bottom of the last line should be trimmed or not.

int
@NonNull String

Public constructors

LineHeightStyle

public LineHeightStyle(
    @NonNull LineHeightStyle.Alignment alignment,
    @NonNull LineHeightStyle.Trim trim
)
Parameters
@NonNull LineHeightStyle.Alignment alignment

defines how to align the line in the space provided by the line height.

@NonNull LineHeightStyle.Trim trim

defines whether the space that would be added to the top of first line, and bottom of the last line should be trimmed or not. This feature is available only when PlatformParagraphStyle.includeFontPadding is false.

Public methods

equals

public boolean equals(Object other)

getAlignment

public final @NonNull LineHeightStyle.Alignment getAlignment()

defines how to align the line in the space provided by the line height.

getTrim

public final @NonNull LineHeightStyle.Trim getTrim()

defines whether the space that would be added to the top of first line, and bottom of the last line should be trimmed or not. This feature is available only when PlatformParagraphStyle.includeFontPadding is false.

hashCode

public int hashCode()

toString

public @NonNull String toString()