# KeyAttribute

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/dsl/KeyAttribute.java+class:androidx.constraintlayout.core.dsl.KeyAttribute) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***

<br />

```
class KeyAttribute : Keys
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.constraintlayout.core.dsl.Keys](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Keys) ||
|   | ↳ | [androidx.constraintlayout.core.dsl.KeyAttribute](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute) |

Known direct subclasses [KeyCycle](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyCycle)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyCycle` |   |

*** ** * ** ***

Provides the API for creating a KeyAttribute Object for use in the Core ConstraintLayout \&MotionLayout system

## Summary

| ### Nested types |
|---|
| `enum https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute.Fit` |
| `enum https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute.Visibility` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#KeyAttribute(int,java.lang.String)(frame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, target: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getAlpha()()` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute.Fit!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getCurveFit()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getPivotX()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getPivotY()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getRotation()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getRotationX()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getRotationY()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getScaleX()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getScaleY()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getTarget()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getTransitionEasing()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getTransitionPathRotate()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getTranslationX()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getTranslationY()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getTranslationZ()()` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute.Visibility!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#getVisibility()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#setAlpha(float)(alpha: 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/dsl/KeyAttribute#setCurveFit(androidx.constraintlayout.core.dsl.KeyAttribute.Fit)(curveFit: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute.Fit!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#setPivotX(float)(pivotX: 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/dsl/KeyAttribute#setPivotY(float)(pivotY: 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/dsl/KeyAttribute#setRotation(float)(rotation: 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/dsl/KeyAttribute#setRotationX(float)(rotationX: 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/dsl/KeyAttribute#setRotationY(float)(rotationY: 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/dsl/KeyAttribute#setScaleX(float)(scaleX: 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/dsl/KeyAttribute#setScaleY(float)(scaleY: 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/dsl/KeyAttribute#setTarget(java.lang.String)(target: 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/dsl/KeyAttribute#setTransitionEasing(java.lang.String)(transitionEasing: 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/dsl/KeyAttribute#setTransitionPathRotate(float)(transitionPathRotate: 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/dsl/KeyAttribute#setTranslationX(float)(translationX: 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/dsl/KeyAttribute#setTranslationY(float)(translationY: 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/dsl/KeyAttribute#setTranslationZ(float)(translationZ: 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/dsl/KeyAttribute#setVisibility(androidx.constraintlayout.core.dsl.KeyAttribute.Visibility)(visibility: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute.Visibility!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#toString()()` |

| ### Protected functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#attributesToString(java.lang.StringBuilder)(builder: https://developer.android.com/reference/java/lang/StringBuilder.html!)` |

| ### Protected properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyAttribute#TYPE()` |

### Inherited functions

From [androidx.constraintlayout.core.dsl.Keys](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Keys) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Keys#append(java.lang.StringBuilder,java.lang.String,java.lang.String[])(builder: https://developer.android.com/reference/java/lang/StringBuilder.html!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, array: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.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/core/dsl/Keys#append(java.lang.StringBuilder,java.lang.String,float[])(builder: https://developer.android.com/reference/java/lang/StringBuilder.html!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, array: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<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/dsl/Keys#append(java.lang.StringBuilder,java.lang.String,float)(builder: https://developer.android.com/reference/java/lang/StringBuilder.html!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/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/dsl/Keys#append(java.lang.StringBuilder,java.lang.String,int)(builder: https://developer.android.com/reference/java/lang/StringBuilder.html!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/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/dsl/Keys#append(java.lang.StringBuilder,java.lang.String,java.lang.String)(builder: https://developer.android.com/reference/java/lang/StringBuilder.html!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/Keys#unpack(java.lang.String[])(str: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)`

## Public constructors

### KeyAttribute

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

```
KeyAttribute(frame: Int, target: String!)
```

## Public functions

### getAlpha

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

```
fun getAlpha(): Float
```

### getCurveFit

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

```
fun getCurveFit(): KeyAttribute.Fit!
```

### getPivotX

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

```
fun getPivotX(): Float
```

### getPivotY

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

```
fun getPivotY(): Float
```

### getRotation

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

```
fun getRotation(): Float
```

### getRotationX

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

```
fun getRotationX(): Float
```

### getRotationY

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

```
fun getRotationY(): Float
```

### getScaleX

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

```
fun getScaleX(): Float
```

### getScaleY

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

```
fun getScaleY(): Float
```

### getTarget

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

```
fun getTarget(): String!
```

### getTransitionEasing

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

```
fun getTransitionEasing(): String!
```

### getTransitionPathRotate

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

```
fun getTransitionPathRotate(): Float
```

### getTranslationX

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

```
fun getTranslationX(): Float
```

### getTranslationY

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

```
fun getTranslationY(): Float
```

### getTranslationZ

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

```
fun getTranslationZ(): Float
```

### getVisibility

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

```
fun getVisibility(): KeyAttribute.Visibility!
```

### setAlpha

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

```
fun setAlpha(alpha: Float): Unit
```

### setCurveFit

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

```
fun setCurveFit(curveFit: KeyAttribute.Fit!): Unit
```

### setPivotX

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

```
fun setPivotX(pivotX: Float): Unit
```

### setPivotY

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

```
fun setPivotY(pivotY: Float): Unit
```

### setRotation

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

```
fun setRotation(rotation: Float): Unit
```

### setRotationX

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

```
fun setRotationX(rotationX: Float): Unit
```

### setRotationY

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

```
fun setRotationY(rotationY: Float): Unit
```

### setScaleX

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

```
fun setScaleX(scaleX: Float): Unit
```

### setScaleY

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

```
fun setScaleY(scaleY: Float): Unit
```

### setTarget

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

```
fun setTarget(target: String!): Unit
```

### setTransitionEasing

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

```
fun setTransitionEasing(transitionEasing: String!): Unit
```

### setTransitionPathRotate

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

```
fun setTransitionPathRotate(transitionPathRotate: Float): Unit
```

### setTranslationX

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

```
fun setTranslationX(translationX: Float): Unit
```

### setTranslationY

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

```
fun setTranslationY(translationY: Float): Unit
```

### setTranslationZ

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

```
fun setTranslationZ(translationZ: Float): Unit
```

### setVisibility

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

```
fun setVisibility(visibility: KeyAttribute.Visibility!): Unit
```

### toString

```
fun toString(): String!
```

## Protected functions

### attributesToString

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

```
protected fun attributesToString(builder: StringBuilder!): Unit
```

## Protected properties

### TYPE

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

```
protected val TYPE: String!
```