# KeyFrames

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/KeyFrames.java+class:androidx.constraintlayout.motion.widget.KeyFrames) Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

*** ** * ** ***


```
class KeyFrames
```

<br />

*** ** * ** ***

The parses the KeyFrame structure in a MotionScene xml

## Summary

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

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyFrames#KeyFrames()()` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyFrames#KeyFrames(android.content.Context,org.xmlpull.v1.XmlPullParser)(context: https://developer.android.com/reference/android/content/Context.html!, parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyFrames#addAllFrames(androidx.constraintlayout.motion.widget.MotionController)(motionController: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionController!)` Do not filter the set by matches |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyFrames#addFrames(androidx.constraintlayout.motion.widget.MotionController)(motionController: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionController!)` add the key frames to the motion controller |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyFrames#addKey(androidx.constraintlayout.motion.widget.Key)(key: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!)` Add a key to this set of keyframes |
| `https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyFrames#getKeyFramesForView(int)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Get the list of keyframes given and ID |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/KeyFrames#getKeys()()` |

## Constants

### UNSET

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

```
const val UNSET = -1: Int
```

## Public constructors

### KeyFrames

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

```
KeyFrames()
```

### KeyFrames

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

```
KeyFrames(context: Context!, parser: XmlPullParser!)
```

## Public functions

### addAllFrames

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

```
fun addAllFrames(motionController: MotionController!): Unit
```

Do not filter the set by matches

| Parameters |
|---|---|
| `motionController: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionController!` |   |

### addFrames

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

```
fun addFrames(motionController: MotionController!): Unit
```

add the key frames to the motion controller

| Parameters |
|---|---|
| `motionController: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionController!` |   |

### addKey

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

```
fun addKey(key: Key!): Unit
```

Add a key to this set of keyframes

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

### getKeyFramesForView

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

```
fun getKeyFramesForView(id: Int): ArrayList<Key!>!
```

Get the list of keyframes given and ID

| Parameters |
|---|---|
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Key!>!` |   |

### getKeys

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

```
fun getKeys(): (Mutable)Set<Int!>!
```