androidx.compose.foundation
basicMarquee
Function · from org.jetbrains.compose.foundation:foundation:1.12.2
No hand-written docs yet.
Applies an animated marquee effect to the modified content if it's too wide to fit in the available space. This modifier has no effect if the content fits in the max constraints. The content will be measured with unbounded width.
Parameters
fun Modifier.basicMarquee(
iterations: Int = Iterations,
animationMode: MarqueeAnimationMode = Immediately,
repeatDelayMillis: Int = RepeatDelayMillis,
initialDelayMillis: Int = if (animationMode == Immediately) repeatDelayMillis else 0,
spacing: MarqueeSpacing = Spacing,
velocity: Dp = Velocity,
): Modifier
iterations: IntOptional
iterations: IntOptionalDefault: Iterations
The number of times to repeat the animation. Int.MAX_VALUE will repeat forever, and 0 will disable animation.
animationMode: MarqueeAnimationModeOptional
animationMode: MarqueeAnimationModeOptionalDefault: Immediately
Whether the marquee should start animating Immediately or only WhileFocused. In WhileFocused mode, the modified node or the content must be made focusable. Note that the initialDelayMillis is part of the animation, so this parameter determines when that initial delay starts counting down, not when the content starts to actually scroll.
repeatDelayMillis: IntOptional
repeatDelayMillis: IntOptionalDefault: RepeatDelayMillis
The duration to wait before starting each subsequent iteration, in millis.
initialDelayMillis: IntOptional
initialDelayMillis: IntOptionalDefault: if (animationMode == Immediately) repeatDelayMillis else 0
The duration to wait before starting the first iteration of the animation, in millis. By default, there will be no initial delay if animationMode is WhileFocused, otherwise the initial delay will be repeatDelayMillis.
spacing: MarqueeSpacingOptional
spacing: MarqueeSpacingOptionalDefault: Spacing
A MarqueeSpacing that specifies how much space to leave at the end of the content before showing the beginning again.
velocity: DpOptional
velocity: DpOptionalDefault: Velocity
The speed of the animation in dps / second. A positive velocity means that the marquee will animate in the direction of the current LayoutDirection.
Library docs
Applies an animated marquee effect to the modified content if it's too wide to fit in the available space. This modifier has no effect if the content fits in the max constraints. The content will be measured with unbounded width.
When the animation is running, it will restart from the initial state any time:
- any of the parameters to this modifier change, or
- the content or container size change.
The animation only affects the drawing of the content, not its position. The offset returned by
the LayoutCoordinates of anything inside the marquee is undefined relative to anything outside
the marquee, and may not match its drawn position on screen. This modifier also does not
currently support content that accepts position-based input such as pointer events.
To only animate when the composable is focused, specify animationMode and make the composable
focusable. This modifier does not add any visual effects aside from scrolling, but you can add
your own by placing modifiers before this one.