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

MarqueeSpacing

@ExperimentalFoundationApi
public fun interface MarqueeSpacing


Defines a calculateSpacing method that determines the space after the end of basicMarquee content before drawing the content again.

Summary

Nested types

public static class MarqueeSpacing.Companion

Public methods

abstract int
@ExperimentalFoundationApi
calculateSpacing(
    @NonNull Density receiver,
    int contentWidth,
    int containerWidth
)

Calculates the space after the end of basicMarquee content before drawing the content again.

Public methods

calculateSpacing

@ExperimentalFoundationApi
abstract int calculateSpacing(
    @NonNull Density receiver,
    int contentWidth,
    int containerWidth
)

Calculates the space after the end of basicMarquee content before drawing the content again.

This is a restartable method: any state used to calculate the result will cause the spacing to be re-calculated when it changes.

Parameters
int contentWidth

The width of the content inside the marquee, in pixels. Will always be larger than containerWidth.

int containerWidth

The width of the marquee itself, in pixels. Will always be smaller than contentWidth.

Returns
int

The space in pixels between the end of the content and the beginning of the content when wrapping.