# KeyPositions

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

*** ** * ** ***

<br />

```
class KeyPositions : 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.KeyPositions](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions) |

*** ** * ** ***

Provides the API for creating a KeyPosition Object for use in the Core ConstraintLayout \&MotionLayout system This allows multiple KeyPosition positions to defined in one object.

## Summary

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

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#KeyPositions(int,java.lang.String...)(numOfFrames: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, targets: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#getFrames()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#getPercentHeight()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#getPercentWidth()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#getPercentX()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#getPercentY()()` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions.Type!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#getPositionType()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#getTarget()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#getTransitionEasing()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#setFrames(int...)(frames: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<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/KeyPositions#setPercentHeight(float...)(percentHeight: 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/KeyPositions#setPercentWidth(float...)(percentWidth: 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/KeyPositions#setPercentX(float...)(percentX: 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/KeyPositions#setPercentY(float...)(percentY: 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/KeyPositions#setPositionType(androidx.constraintlayout.core.dsl.KeyPositions.Type)(positionType: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions.Type!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/dsl/KeyPositions#setTransitionEasing(java.lang.String)(transitionEasing: 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/KeyPositions#toString()()` |

### 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

### KeyPositions

```
KeyPositions(numOfFrames: Int, targets: Array<String!>!)
```

## Public functions

### getFrames

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

```
fun getFrames(): Array<Int>!
```

### getPercentHeight

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

```
fun getPercentHeight(): Array<Float>!
```

### getPercentWidth

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

```
fun getPercentWidth(): Array<Float>!
```

### getPercentX

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

```
fun getPercentX(): Array<Float>!
```

### getPercentY

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

```
fun getPercentY(): Array<Float>!
```

### getPositionType

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

```
fun getPositionType(): KeyPositions.Type!
```

### getTarget

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

```
fun getTarget(): Array<String!>!
```

### getTransitionEasing

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

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

### setFrames

```
fun setFrames(frames: IntArray<Int>!): Unit
```

### setPercentHeight

```
fun setPercentHeight(percentHeight: FloatArray<Float>!): Unit
```

### setPercentWidth

```
fun setPercentWidth(percentWidth: FloatArray<Float>!): Unit
```

### setPercentX

```
fun setPercentX(percentX: FloatArray<Float>!): Unit
```

### setPercentY

```
fun setPercentY(percentY: FloatArray<Float>!): Unit
```

### setPositionType

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

```
fun setPositionType(positionType: KeyPositions.Type!): Unit
```

### setTransitionEasing

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

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

### toString

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