MarqueeText

fun MarqueeText(text: AnnotatedString, modifier: Modifier = Modifier, inlineContent: Map<String, InlineTextContent> = mapOf(), color: Color = Color.Unspecified, style: TextStyle = LocalTextStyle.current, textAlign: TextAlign = TextAlign.Left, followGap: Dp = 96.dp, edgeGradientWidth: Dp = 16.dp, marqueeDpPerSecond: Dp = 64.dp, pauseTime: Duration = 4.seconds)

Show a single line Marquee text, with a pause (initial and between cycles) and speed.

Otherwise is mostly the same as the Text composable, without params that don't apply for marquee, such as maxLines.

Only scrolls if required, and otherwise uses textAlign to show the content in a stationary position.

Parameters

text

The text to be displayed, where AnnotatedString allows multiple styles to be used.

modifier

Modifier to apply to this layout node.

inlineContent

A map store composables that replaces certain ranges of the text. It's used to insert composables into text layout. Check InlineTextContent for more information.

color

Color to apply to the text. If Color.Unspecified, and style has no color set, this will be LocalContentColor.

style

Style configuration for the text such as color, font, line height etc.

textAlign

The alignment of the text within the lines of the paragraph. See TextStyle.textAlign.

followGap

the width between end of each scrolling text and the start of the following one.

edgeGradientWidth

the width of the fade out zone on the edges, so text isn't cut off harshly.

marqueeDpPerSecond

the speed of scrolling in dp per second.

pauseTime

the duration before initially scrolling and each additional scroll.


fun MarqueeText(text: String, modifier: Modifier = Modifier, color: Color = Color.Unspecified, style: TextStyle = LocalTextStyle.current, textAlign: TextAlign = TextAlign.Left, followGap: Dp = 96.dp, edgeGradientWidth: Dp = 16.dp, marqueeDpPerSecond: Dp = 64.dp, pauseTime: Duration = 4.seconds)

Show a single line Marquee text, with a pause (initial and between cycles) and speed.

Otherwise is mostly the same as the Text composable, without params that don't apply for marquee, such as maxLines.

Only scrolls if required, and otherwise uses textAlign to show the content in a stationary position.

Parameters

text

The text to be displayed.

modifier

Modifier to apply to this layout node.

color

Color to apply to the text. If Color.Unspecified, and style has no color set, this will be LocalContentColor.

style

Style configuration for the text such as color, font, line height etc.

textAlign

The alignment of the text within the lines of the paragraph. See TextStyle.textAlign.

followGap

the width between end of each scrolling text and the start of the following one.

edgeGradientWidth

the width of the fade out zone on the edges, so text isn't cut off harshly.

marqueeDpPerSecond

the speed of scrolling in dp per second.

pauseTime

the duration before initially scrolling and each additional scroll.