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

*** ** * ** ***


```
public class KeyFrames
```

<br />

*** ** * ** ***

The parses the KeyFrame structure in a MotionScene xml

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/KeyFrames#UNSET() = -1` |

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

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/KeyFrames#addAllFrames(androidx.constraintlayout.motion.widget.MotionController)(https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionController motionController)` Do not filter the set by matches |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/KeyFrames#addFrames(androidx.constraintlayout.motion.widget.MotionController)(https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionController motionController)` add the key frames to the motion controller |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/KeyFrames#addKey(androidx.constraintlayout.motion.widget.Key)(https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Key key)` Add a key to this set of keyframes |
| `https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Key>` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/KeyFrames#getKeyFramesForView(int)(int id)` Get the list of keyframes given and ID |
| `https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/Integer.html>` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/KeyFrames#getKeys()()` |

## Constants

### UNSET

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

```
public static final int UNSET = -1
```

## Public constructors

### KeyFrames

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

```
public KeyFrames()
```

### KeyFrames

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

```
public KeyFrames(Context context, XmlPullParser parser)
```

## Public methods

### addAllFrames

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

```
public void addAllFrames(MotionController motionController)
```

Do not filter the set by matches

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

### addFrames

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

```
public void addFrames(MotionController motionController)
```

add the key frames to the motion controller

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

### addKey

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

```
public void addKey(Key key)
```

Add a key to this set of keyframes

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

### getKeyFramesForView

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

```
public ArrayList<Key> getKeyFramesForView(int id)
```

Get the list of keyframes given and ID

| Parameters |
|---|---|
| `int id` |   |

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

### getKeys

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

```
public Set<Integer> getKeys()
```