# TransformationVariableSpec

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/lazy/TransformationSpec.kt+class:androidx.wear.compose.material3.lazy.TransformationVariableSpec) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)


```
class TransformationVariableSpec
```

<br />

*** ** * ** ***

This class represents the configuration parameters for one variable that changes as the item moves on the screen and will be used to apply the corresponding transformation - for example: container alpha. When an item enters from the top of the screen the value of this variable will be `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#topValue()`. As the item's bottom edge moves through the top transformation zone (inside the top transition area), this variable will change from `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#topValue()` to target value (target value is the nominal value of this variable, with no transformation applied, such as 1f for alpha). When the item's top edge moves through the bottom transformation zone (inside the bottom transition area), this variable will change from the target value into `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#bottomValue()`, and keep that value until it leaves the screen. The same process happens in reverse, entering from the bottom of the screen and leaving at the top.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#TransformationVariableSpec(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)( topValue: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, targetValue: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, bottomValue: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, transformationZoneEnterFraction: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, transformationZoneExitFraction: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#copy(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)( topValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, targetValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, bottomValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, transformationZoneEnterFraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, transformationZoneExitFraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Returns a copy of the TransformationVariableSpec. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#toString()()` |

| ### Public properties |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#bottomValue()` The value this variable will have when the item's top edge is below the bottom transformation zone, usually this happens when it is (or is about to be) partially outside of the screen on the bottom side. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#targetValue()` The value this variable will have when the item is not in either transformation zone, and is in the "center" of the screen, i.e. the top edge is above the bottom transformation zone, and the bottom edge is below the top transformation zone. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#topValue()` The value this variable will have when the item's bottom edge is above the top transformation zone, usually this happens when it is (or is about to be) partially outside of the screen on the top side. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#transformationZoneEnterFraction()` Defines how far into the transition area the transformation zone starts. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#transformationZoneExitFraction()` Defines how far into the transition area the transformation zone ends. |

## Public constructors

### TransformationVariableSpec

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
TransformationVariableSpec(
    topValue: @FloatRange(from = 0.0, to = 1.0) Float,
    targetValue: @FloatRange(from = 0.0, to = 1.0) Float = 1.0f,
    bottomValue: @FloatRange(from = 0.0, to = 1.0) Float = topValue,
    transformationZoneEnterFraction: @FloatRange(from = 0.0, to = 1.0) Float = 0.0f,
    transformationZoneExitFraction: @FloatRange(from = 0.0, to = 1.0) Float = 1.0f
)
```

## Public functions

### copy

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
fun copy(
    topValue: Float = this.topValue,
    targetValue: Float = this.targetValue,
    bottomValue: Float = this.bottomValue,
    transformationZoneEnterFraction: Float = this.transformationZoneEnterFraction,
    transformationZoneExitFraction: Float = this.transformationZoneExitFraction
): TransformationVariableSpec
```

Returns a copy of the TransformationVariableSpec.

### equals

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

### hashCode

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

### toString

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

## Public properties

### bottomValue

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val bottomValue: @FloatRange(from = 0.0, to = 1.0) Float
```

The value this variable will have when the item's top edge is below the bottom transformation zone, usually this happens when it is (or is about to be) partially outside of the screen on the bottom side.

### targetValue

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val targetValue: @FloatRange(from = 0.0, to = 1.0) Float
```

The value this variable will have when the item is not in either transformation zone, and is in the "center" of the screen, i.e. the top edge is above the bottom transformation zone, and the bottom edge is below the top transformation zone.

### topValue

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val topValue: @FloatRange(from = 0.0, to = 1.0) Float
```

The value this variable will have when the item's bottom edge is above the top transformation zone, usually this happens when it is (or is about to be) partially outside of the screen on the top side.

### transformationZoneEnterFraction

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val transformationZoneEnterFraction: @FloatRange(from = 0.0, to = 1.0) Float
```

Defines how far into the transition area the transformation zone starts. For example, a value of 0.5f means that when the item enters the screen from the top, this variable will not start to transform until the bottom of the item reaches the middle point of the transition area. Should be less than `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`.

Visually, the top transition area and top transformation zone can be visualized as:

```kotlin
   ˅  --- <-- Top of the screen
   |  |                   |
   |  |---| <- Enter fraction, item moving down
TA |  |        TZ         | <- Transformation Zone
   |  |---| <- Exit fraction, item moving down
   |  |                   |
   ^  |---|
```

On the bottom, it is the same mirrored vertically (exit fraction is above enter fraction). It is also worth noting that in the bottom, it is the top of the item that triggers starting and ending transformations.

### transformationZoneExitFraction

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val transformationZoneExitFraction: @FloatRange(from = 0.0, to = 1.0) Float
```

Defines how far into the transition area the transformation zone ends. For example, a value of 0.5f means that when the item is moving down, its bottom edge needs to reach the middle point of the transition area for this variable to reach its maximum/target value. Should be greater than `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`.

See also `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/lazy/TransformationVariableSpec#(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)`