# TransformationKt

Added in 1.4.2

*** ** * ** ***


```
public final class TransformationKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).pivotX(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float staticValueDp, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDp )` Sets the horizontal pivot offset for scaling and rotation as an absolute distance from the element center. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).pivotY(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float staticValueDp, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDp )` Sets the vertical pivot offset for scaling and rotation as an absolute distance from the element center. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).ratioPivotX(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, float staticRatio, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicRatio )` Sets the horizontal pivot point for scaling and rotation as a location proportional to the bounding box width. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).ratioPivotY(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, float staticRatio, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicRatio )` Sets the vertical pivot point for scaling and rotation as a location proportional to the bounding box height. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).rotate(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, float staticValueDegrees, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDegrees )` Rotates the layout element. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).scaleX(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float staticValue, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValue )` Scales the layout element along the X axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).scaleY(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float staticValue, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValue )` Scales the layout element along the Y axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).translateX(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float staticValueDp, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDp )` Applies a translation to the layout element along the X axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/TransformationKt#(androidx.wear.protolayout.modifiers.LayoutModifier).translateY(kotlin.Float,androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float staticValueDp, https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDp )` Applies a translation to the layout element along the Y axis. |

## Public methods

### pivotX

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:pivotX) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier pivotX(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)
```

Sets the horizontal pivot offset for scaling and rotation as an absolute distance from the element center.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float staticValueDp` | The static horizontal pivot in DP. |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDp` | The dynamic horizontal pivot offset. |

### pivotY

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:pivotY) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier pivotY(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)
```

Sets the vertical pivot offset for scaling and rotation as an absolute distance from the element center.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float staticValueDp` | The static vertical pivot in DP. |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDp` | The dynamic vertical pivot offset. |

### ratioPivotX

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:ratioPivotX) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier ratioPivotX(
    @NonNull LayoutModifier receiver,
    float staticRatio,
    DynamicBuilders.DynamicFloat dynamicRatio
)
```

Sets the horizontal pivot point for scaling and rotation as a location proportional to the bounding box width.

| Parameters |
|---|---|
| `float staticRatio` | The static horizontal pivot ratio (e.g., 0.5 for center). Value outside 0, 1 are also valid. |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicRatio` | The dynamic horizontal pivot ratio. |

### ratioPivotY

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:ratioPivotY) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier ratioPivotY(
    @NonNull LayoutModifier receiver,
    float staticRatio,
    DynamicBuilders.DynamicFloat dynamicRatio
)
```

Sets the vertical pivot point for scaling and rotation as a location proportional to the bounding box height.

| Parameters |
|---|---|
| `float staticRatio` | The static vertical pivot ratio (e.g., 0.5 for center). Value outside 0, 1 are also valid. |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicRatio` | The dynamic vertical pivot ratio. |

### rotate

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:rotate) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier rotate(
    @NonNull LayoutModifier receiver,
    float staticValueDegrees,
    DynamicBuilders.DynamicFloat dynamicValueDegrees
)
```

Rotates the layout element. Positive values result in clockwise rotation.

| Parameters |
|---|---|
| `float staticValueDegrees` | The static rotation angle in degrees. |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDegrees` | The dynamic rotations angle for animations or state binding. |

### scaleX

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:scaleX) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier scaleX(
    @NonNull LayoutModifier receiver,
    @FloatRange(from = 0.0) float staticValue,
    DynamicBuilders.DynamicFloat dynamicValue
)
```

Scales the layout element along the X axis.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float staticValue` | The static scale factor (1.0 is original size). |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValue` | The dynamic scale factor for animations or state binding. |

### scaleY

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:scaleY) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier scaleY(
    @NonNull LayoutModifier receiver,
    @FloatRange(from = 0.0) float staticValue,
    DynamicBuilders.DynamicFloat dynamicValue
)
```

Scales the layout element along the Y axis.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float staticValue` | The static scale factor (1.0 is original size). |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValue` | The dynamic scale factor for animations or state binding. |

### translateX

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:translateX) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier translateX(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)
```

Applies a translation to the layout element along the X axis.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float staticValueDp` | The static offset in DP. |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDp` | The dynamic offset for animations or state binding. |

### translateY

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Transformation.kt+function:translateY) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier translateY(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)
```

Applies a translation to the layout element along the Y axis.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float staticValueDp` | The static offset in DP. |
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat dynamicValueDp` | The dynamic offset for animations or state binding. |