# TextMotion

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

  ```
  class TextMotion
  ```

*** ** * ** ***

Configures glyph rendering and placement for readability or smooth animations.

```kotlin
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.Text
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.TransformOrigin
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.text.style.TextMotion

val infiniteTransition = rememberInfiniteTransition()
val scale by
    infiniteTransition.animateFloat(
        initialValue = 1f,
        targetValue = 8f,
        animationSpec = infiniteRepeatable(tween(1000), RepeatMode.Reverse),
    )

Text(
    text = "Hello",
    modifier =
        Modifier.graphicsLayer {
            scaleX = scale
            scaleY = scale
            transformOrigin = TransformOrigin.Center
        },
    // Text composable does not take TextMotion as a parameter.
    // Provide it via style argument but make sure that we are copying from current theme
    style = LocalTextStyle.current.copy(textMotion = TextMotion.Animated),
)
```

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextMotion` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextMotion#Animated()` Renders text with maximum linearity to provide smooth scaling, translating, or rotating animations. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextMotion` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextMotion#Static()` Optimizes rendering for readability. | Cmn android |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextMotion#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextMotion#hashCode()()` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextMotion#toString()()` | android |

## Public companion properties

### Animated

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

```
val Animated: TextMotion
```

Renders text with maximum linearity to provide smooth scaling, translating, or rotating animations.

May slightly reduce readability on low-DPI devices.

### Static

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

```
val Static: TextMotion
```

Optimizes rendering for readability.

Use for static (non-animated) text. This is the default.

## Public functions

### equals

android

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

android

```
open fun hashCode(): Int
```

### toString

android

```
open fun toString(): String
```