Package 

Class ExpandableTextKt

    • Method Summary

      Modifier and Type Method Description
      final static Unit ExpandableText(String text, Modifier modifier, Integer minLines, Integer maxLines, Color color, TextUnit fontSize, FontStyle fontStyle, FontWeight fontWeight, FontFamily fontFamily, TextUnit letterSpacing, TextDecoration textDecoration, TextAlign textAlign, TextUnit lineHeight, Boolean softWrap, TextOverflow overflow, Function1<TextLayoutResult, Unit> onTextLayout, TextStyle style, AnimationSpec<Float> animationSpec, Function0<Unit> trailingContent) A text composable that animates smoothly when maxLines changes.
      final static Unit ExpandableText(AnnotatedString text, Modifier modifier, Integer minLines, Integer maxLines, Color color, TextUnit fontSize, FontStyle fontStyle, FontWeight fontWeight, FontFamily fontFamily, TextUnit letterSpacing, TextDecoration textDecoration, TextAlign textAlign, TextUnit lineHeight, Boolean softWrap, TextOverflow overflow, Function1<TextLayoutResult, Unit> onTextLayout, TextStyle style, AnimationSpec<Float> animationSpec, Function0<Unit> trailingContent) A text composable that animates smoothly when maxLines changes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • ExpandableText

        @Composable() final static Unit ExpandableText(String text, Modifier modifier, Integer minLines, Integer maxLines, Color color, TextUnit fontSize, FontStyle fontStyle, FontWeight fontWeight, FontFamily fontFamily, TextUnit letterSpacing, TextDecoration textDecoration, TextAlign textAlign, TextUnit lineHeight, Boolean softWrap, TextOverflow overflow, Function1<TextLayoutResult, Unit> onTextLayout, TextStyle style, AnimationSpec<Float> animationSpec, Function0<Unit> trailingContent)

        A text composable that animates smoothly when maxLines changes.

        Unlike the standard Text composable which jumps to the new line count immediately, this composable animates the height transition when expanding or collapsing.

        This composable mirrors the standard Text API as closely as possible, with the key difference being that height changes are animated rather than instant.

        Parameters:
        text - The text to display.
        modifier - Modifier to be applied to the layout.
        minLines - The minimum number of lines to display.
        maxLines - The maximum number of lines to display.
        color - Color to apply to the text.
        fontSize - The size of glyphs to use when painting the text.
        fontStyle - The typeface variant to use (e.g., italic).
        fontWeight - The typeface thickness to use (e.g., bold).
        fontFamily - The font family to use.
        letterSpacing - The amount of space to add between each letter.
        textDecoration - The decorations to paint on the text (e.g., underline).
        textAlign - The alignment of the text within its container.
        lineHeight - Line height for the text.
        softWrap - Whether the text should break at soft line breaks.
        overflow - Overflow behavior supported by ExpandableText.
        onTextLayout - Callback invoked when the text layout is calculated.
        style - Style configuration for the text.
        animationSpec - The animation specification used for the expand/collapse animation.
        trailingContent - Optional composable appended at the end of the visible text.
      • ExpandableText

        @Composable() final static Unit ExpandableText(AnnotatedString text, Modifier modifier, Integer minLines, Integer maxLines, Color color, TextUnit fontSize, FontStyle fontStyle, FontWeight fontWeight, FontFamily fontFamily, TextUnit letterSpacing, TextDecoration textDecoration, TextAlign textAlign, TextUnit lineHeight, Boolean softWrap, TextOverflow overflow, Function1<TextLayoutResult, Unit> onTextLayout, TextStyle style, AnimationSpec<Float> animationSpec, Function0<Unit> trailingContent)

        A text composable that animates smoothly when maxLines changes.

        This overload accepts AnnotatedString for rich text support with spans and inline content.

        Parameters:
        text - The annotated text to display.
        modifier - Modifier to be applied to the layout.
        minLines - The minimum number of lines to display.
        maxLines - The maximum number of lines to display.
        color - Color to apply to the text.
        fontSize - The size of glyphs to use when painting the text.
        fontStyle - The typeface variant to use (e.g., italic).
        fontWeight - The typeface thickness to use (e.g., bold).
        fontFamily - The font family to use.
        letterSpacing - The amount of space to add between each letter.
        textDecoration - The decorations to paint on the text (e.g., underline).
        textAlign - The alignment of the text within its container.
        lineHeight - Line height for the text.
        softWrap - Whether the text should break at soft line breaks.
        overflow - Overflow behavior supported by ExpandableText.
        onTextLayout - Callback invoked when the text layout is calculated.
        style - Style configuration for the text.
        animationSpec - The animation specification used for the expand/collapse animation.
        trailingContent - Optional composable appended at the end of the visible text.