# MarqueeSpacing

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/BasicMarquee.kt+class:androidx.compose.foundation.MarqueeSpacing) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.4.0) Common/AllAndroid/JVM
- Cmn

  ```
  fun interface MarqueeSpacing
  ```

*** ** * ** ***

Defines a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MarqueeSpacing#(androidx.compose.ui.unit.Density).calculateSpacing(kotlin.Int,kotlin.Int)` method that determines the space after the end of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/basicMarquee.modifier#(androidx.compose.ui.Modifier).basicMarquee(kotlin.Int,androidx.compose.foundation.MarqueeAnimationMode,kotlin.Int,kotlin.Int,androidx.compose.foundation.MarqueeSpacing,androidx.compose.ui.unit.Dp)` content before drawing the content again.

## Summary

| ### Public companion functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MarqueeSpacing` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MarqueeSpacing#fractionOfContainer(kotlin.Float)(fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MarqueeSpacing` that is a fraction of the container's width. | Cmn |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density.https://developer.android.com/reference/kotlin/androidx/compose/foundation/MarqueeSpacing#(androidx.compose.ui.unit.Density).calculateSpacing(kotlin.Int,kotlin.Int)(contentWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, containerWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Calculates the space after the end of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/basicMarquee.modifier#(androidx.compose.ui.Modifier).basicMarquee(kotlin.Int,androidx.compose.foundation.MarqueeAnimationMode,kotlin.Int,kotlin.Int,androidx.compose.foundation.MarqueeSpacing,androidx.compose.ui.unit.Dp)` content before drawing the content again. | Cmn |

## Public companion functions

### fractionOfContainer

Cmn Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.4.0)

```
fun fractionOfContainer(fraction: Float): MarqueeSpacing
```

A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MarqueeSpacing` that is a fraction of the container's width.

## Public functions

### Density.calculateSpacing

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/BasicMarquee.kt+function:calculateSpacing) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.4.0)

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

Calculates the space after the end of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/basicMarquee.modifier#(androidx.compose.ui.Modifier).basicMarquee(kotlin.Int,androidx.compose.foundation.MarqueeAnimationMode,kotlin.Int,kotlin.Int,androidx.compose.foundation.MarqueeSpacing,androidx.compose.ui.unit.Dp)` 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: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The width of the content inside the marquee, in pixels. Will always be larger than `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MarqueeSpacing#(androidx.compose.ui.unit.Density).calculateSpacing(kotlin.Int,kotlin.Int)`. |
| `containerWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The width of the marquee itself, in pixels. Will always be smaller than `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MarqueeSpacing#(androidx.compose.ui.unit.Density).calculateSpacing(kotlin.Int,kotlin.Int)`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The space in pixels between the end of the content and the beginning of the content when wrapping. |