# MotionKeyAttributes

Artifact: [androidx.constraintlayout:constraintlayout-core](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/core/motion/key/MotionKeyAttributes.java+class:androidx.constraintlayout.core.motion.key.MotionKeyAttributes) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***


```
class MotionKeyAttributes : MotionKey
```

<br />

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

*** ** * ** ***

## Summary

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

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#addValues(java.util.HashMap<java.lang.String,androidx.constraintlayout.core.motion.utils.SplineSet>)(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/core/motion/utils/SplineSet!>!)` Defines method to add a a view to splines derived form this key frame. |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#clone()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#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/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#getCurveFit()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#getId(java.lang.String)(name: 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/core/motion/key/MotionKeyAttributes#printAttributes()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#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!>!)` Key frame can specify the type of interpolation it wants on various attributes For each string it set it to -1, CurveFit.LINEAR or CurveFit.SPLINE |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#setValue(int,float)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Used to set float values |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#setValue(int,int)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Used to set integer values |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKeyAttributes#setValue(int,java.lang.String)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Used to set String values |

| ### Inherited Constants |
|---|
| From [androidx.constraintlayout.core.motion.key.MotionKey](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey) |---|---| | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#ALPHA() = "alpha"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#CUSTOM() = "CUSTOM"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#ELEVATION() = "elevation"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#ROTATION() = "rotationZ"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#ROTATION_X() = "rotationX"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#SCALE_X() = "scaleX"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#SCALE_Y() = "scaleY"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#TRANSITION_PATH_ROTATE() = "transitionPathRotate"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#TRANSLATION_X() = "translationX"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#TRANSLATION_Y() = "translationY"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#VISIBILITY() = "visibility"` | |
| From [androidx.constraintlayout.core.motion.utils.TypedValues](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues) |---|---| | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#BOOLEAN_MASK() = 1` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#FLOAT_MASK() = 4` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#INT_MASK() = 2` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#STRING_MASK() = 8` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#S_CUSTOM() = "CUSTOM"` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#TYPE_FRAME_POSITION() = 100` | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#TYPE_TARGET() = 101` | |

| ### Inherited functions |
|---|
| From [androidx.constraintlayout.core.motion.key.MotionKey](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey) |---|---| | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#copy(androidx.constraintlayout.core.motion.key.MotionKey)(src: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#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/core/motion/key/MotionKey#setCustomAttribute(java.lang.String,int,boolean)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#setCustomAttribute(java.lang.String,int,float)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#setCustomAttribute(java.lang.String,int,int)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#setCustomAttribute(java.lang.String,int,java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: 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/core/motion/key/MotionKey#setFramePosition(int)(pos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` sets the frame position | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#setValue(int,boolean)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Used to set boolean values | | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#setViewId(int)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | |
| From [androidx.constraintlayout.core.motion.utils.TypedValues](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues) |---|---| | `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#setValue(int,boolean)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Used to set boolean values | | `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#setValue(int,float)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Used to set float values | | `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#setValue(int,int)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Used to set integer values | | `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#setValue(int,java.lang.String)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Used to set String values | |

| ### Inherited properties |
|---|
| From [androidx.constraintlayout.core.motion.key.MotionKey](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey) |---|---| | `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#UNSET()` | | `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/core/motion/CustomVariable!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#mCustom()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#mFramePosition()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey#mType()` | |

## Constants

### KEY_TYPE

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

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

## Public constructors

### MotionKeyAttributes

Added in 1.1.2

```
MotionKeyAttributes()
```

## Public functions

### addValues

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

```
fun addValues(splines: HashMap<String!, SplineSet!>!): 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/core/motion/utils/SplineSet!>!` | splines to write values to |

### clone

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

```
fun clone(): MotionKey!
```

### getAttributeNames

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

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

### getCurveFit

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

```
fun getCurveFit(): Int
```

### getId

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

```
fun getId(name: String!): Int
```

### printAttributes

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

```
fun printAttributes(): Unit
```

### setInterpolation

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

Key frame can specify the type of interpolation it wants on various attributes For each string it set it to -1, CurveFit.LINEAR or CurveFit.SPLINE

### setValue

```
fun setValue(type: Int, value: Float): Boolean
```

Used to set float values

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if it accepted the value |

### setValue

```
fun setValue(type: Int, value: Int): Boolean
```

Used to set integer values

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if it accepted the value |

### setValue

```
fun setValue(type: Int, value: String!): Boolean
```

Used to set String values

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if it accepted the value |