# MotionLayout.MotionTracker

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

*** ** * ** ***


```
protected interface MotionLayout.MotionTracker
```

<br />

*** ** * ** ***

Subclasses can override to build test frameworks

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#addMovement(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent.html event)` |
| `abstract void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#clear()()` |
| `abstract void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#computeCurrentVelocity(int)(int units)` |
| `abstract void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#computeCurrentVelocity(int,float)(int units, float maxVelocity)` |
| `abstract float` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#getXVelocity()()` |
| `abstract float` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#getXVelocity(int)(int id)` |
| `abstract float` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#getYVelocity()()` |
| `abstract float` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#getYVelocity(int)(int id)` |
| `abstract void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.MotionTracker#recycle()()` |

## Public methods

### addMovement

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

```
abstract void addMovement(MotionEvent event)
```

### clear

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

```
abstract void clear()
```

### computeCurrentVelocity

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

```
abstract void computeCurrentVelocity(int units)
```

### computeCurrentVelocity

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

```
abstract void computeCurrentVelocity(int units, float maxVelocity)
```

### getXVelocity

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

```
abstract float getXVelocity()
```

### getXVelocity

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

```
abstract float getXVelocity(int id)
```

### getYVelocity

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

```
abstract float getYVelocity()
```

### getYVelocity

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

```
abstract float getYVelocity(int id)
```

### recycle

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

```
abstract void recycle()
```