MarqueeSpacing


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

Summary

Public companion functions

MarqueeSpacing

A MarqueeSpacing that is a fraction of the container's width.

Cmn

Public functions

Int
Density.calculateSpacing(contentWidth: Int, containerWidth: Int)

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

Cmn

Public companion functions

fractionOfContainer

fun fractionOfContainer(fraction: Float): MarqueeSpacing

A MarqueeSpacing that is a fraction of the container's width.

Public functions

calculateSpacing

fun Density.calculateSpacing(contentWidth: Int, containerWidth: Int): Int

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
contentWidth: Int

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

containerWidth: Int

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.