# KeyAttributes

Artifact: [androidx.constraintlayout:constraintlayout](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/motion/widget/KeyAttributes.java+class:androidx.constraintlayout.motion.widget.KeyAttributes) Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

*** ** * ** ***


```
class KeyAttributes : Key
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.constraintlayout.motion.widget.Key](https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key) ||
|   | ↳ | [androidx.constraintlayout.motion.widget.KeyAttributes](https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes) |

*** ** * ** ***

Defines container for a key frame of for storing KeyAttributes. KeyAttributes change post layout values of a view.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#KEY_TYPE() = 1` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#KeyAttributes()()` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#addValues(java.util.HashMap<java.lang.String,androidx.constraintlayout.motion.utils.ViewSpline>)(splines: https://developer.android.com/reference/java/util/HashMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/utils/ViewSpline!>!)` Defines method to add a a view to splines derived form this key frame. |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#clone()()` Clone this KeyAttributes |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#copy(androidx.constraintlayout.motion.widget.Key)(src: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!)` Copy the key |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#getAttributeNames(java.util.HashSet<java.lang.String>)(attributes: https://developer.android.com/reference/java/util/HashSet.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#load(android.content.Context,android.util.AttributeSet)(context: https://developer.android.com/reference/android/content/Context.html!, attrs: https://developer.android.com/reference/android/util/AttributeSet.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#setInterpolation(java.util.HashMap<java.lang.String,java.lang.Integer>)(interpolation: https://developer.android.com/reference/java/util/HashMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!)` create the interpolations associated with this KeyAttribute |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyAttributes#setValue(java.lang.String,java.lang.Object)(tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` Set the value associated with this tag |

| ### Inherited Constants |
|---|
| From [androidx.constraintlayout.motion.widget.Key](https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key) |---|---| | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#ALPHA() = "alpha"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#CURVEFIT() = "curveFit"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#CUSTOM() = "CUSTOM"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#ELEVATION() = "elevation"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#MOTIONPROGRESS() = "motionProgress"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#PIVOT_X() = "transformPivotX"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#PIVOT_Y() = "transformPivotY"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#PROGRESS() = "progress"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#ROTATION() = "rotation"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#ROTATION_X() = "rotationX"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#ROTATION_Y() = "rotationY"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#SCALE_X() = "scaleX"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#SCALE_Y() = "scaleY"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#TRANSITIONEASING() = "transitionEasing"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#TRANSITION_PATH_ROTATE() = "transitionPathRotate"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#TRANSLATION_X() = "translationX"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#TRANSLATION_Y() = "translationY"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#TRANSLATION_Z() = "translationZ"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#VISIBILITY() = "visibility"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#WAVE_OFFSET() = "waveOffset"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#WAVE_PERIOD() = "wavePeriod"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#WAVE_PHASE() = "wavePhase"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#WAVE_VARIES_BY() = "waveVariesBy"` | |

| ### Inherited functions |
|---|
| From [androidx.constraintlayout.motion.widget.Key](https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#getFramePosition()()` Gets the current frame position | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#setFramePosition(int)(pos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` sets the frame position | | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#setViewId(int)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` set the id of the view | |

| ### Inherited properties |
|---|
| From [androidx.constraintlayout.motion.widget.Key](https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key) |---|---| | `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#UNSET()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key#mType()` | |

## Constants

### KEY_TYPE

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
const val KEY_TYPE = 1: Int
```

## Public constructors

### KeyAttributes

Added in 2.2.2

```
KeyAttributes()
```

## Public functions

### addValues

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
fun addValues(splines: HashMap<String!, ViewSpline!>!): Unit
```

Defines method to add a a view to splines derived form this key frame. The values are written to the spline

| Parameters |
|---|---|
| `splines: https://developer.android.com/reference/java/util/HashMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/utils/ViewSpline!>!` | splines to write values to |

### clone

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
fun clone(): Key!
```

Clone this KeyAttributes

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!` |   |

### copy

```
fun copy(src: Key!): Key!
```

Copy the key

| Parameters |
|---|---|
| `src: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!` | to be copied |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!` | self |

### getAttributeNames

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
fun getAttributeNames(attributes: HashSet<String!>!): Unit
```

### load

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
fun load(context: Context!, attrs: AttributeSet!): Unit
```

### setInterpolation

```
fun setInterpolation(interpolation: HashMap<String!, Int!>!): Unit
```

create the interpolations associated with this KeyAttribute

| Parameters |
|---|---|
| `interpolation: https://developer.android.com/reference/java/util/HashMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | will be added to with keyAttributes |

### setValue

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
fun setValue(tag: String!, value: Any!): Unit
```

Set the value associated with this tag

| Parameters |
|---|---|
| `tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |