# Motion

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

*** ** * ** ***

<br />

```
class Motion : TypedValues
```

<br />

*** ** * ** ***

Contains the picture of a view through a transition and is used to interpolate it. During a transition every view has a MotionController which drives its position.

All parameter which affect a views motion are added to MotionController and then setup() builds out the splines that control the view.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#DRAW_PATH_AS_CONFIGURED() = 4` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#DRAW_PATH_BASIC() = 1` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#DRAW_PATH_CARTESIAN() = 3` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#DRAW_PATH_NONE() = 0` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#DRAW_PATH_RECTANGLE() = 5` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#DRAW_PATH_RELATIVE() = 2` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#DRAW_PATH_SCREEN() = 6` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#HORIZONTAL_PATH_X() = 2` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#HORIZONTAL_PATH_Y() = 3` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#PATH_PERCENT() = 0` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#PATH_PERPENDICULAR() = 1` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#ROTATION_LEFT() = 2` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#ROTATION_RIGHT() = 1` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#VERTICAL_PATH_X() = 4` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#VERTICAL_PATH_Y() = 5` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#Motion(androidx.constraintlayout.core.motion.MotionWidget)(view: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#addKey(androidx.constraintlayout.core.motion.key.MotionKey)(key: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/key/MotionKey!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#buildKeyFrames(float[],int[],int[])( keyFrames: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!, pos: 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/motion/Motion#buildPath(float[],int)(points: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!, pointCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Fills the array point with the center coordinates. point\[0\] is filled with the x coordinate of "time" 0.0 mPoints\[point.length-1\] is filled with the y coordinate of "time" 1.0 |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#buildRect(float,float[],int)(p: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, path: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getAnimateRelativeTo()()` Returns the id of the view to move relative to. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getCenter(double,float[],float[])(p: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, pos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!, vel: 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/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getCenterX()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getCenterY()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getDpDt(float,float,float,float[])( position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, locationX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, locationY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, mAnchorDpDt: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>! )` This returns the differential with respect to the animation layout position (Progress) of a point on the view (post layout effects are not computed) |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getDrawPath()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getFinalHeight()()` get the width of the widget at the end of the movement. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getFinalWidth()()` get the width of the widget at the end of the movement. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getFinalX()()` get the left most position of the widget at the end of the movement. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getFinalY()()` get the top most position of the widget at the end of the movement. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getId(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionPaths!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getKeyFrame(int)(i: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` provides access to MotionPath objects |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getKeyFrameInfo(int,int[])(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, info: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` Gets the keyFrames for the view controlled by this MotionController. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getKeyFramePositions(int[],float[])(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!, pos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!)` Get the keyFrames for the view controlled by this MotionController |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getMotionStagger()()` The values set in motion: { stagger: '2' } |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getStartHeight()()` get the width of the widget at the start of the movement. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getStartWidth()()` get the width of the widget at the start of the movement. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getStartX()()` get the left most position of the widget at the start of the movement. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getStartY()()` get the top most position of the widget at the start of the movement. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getTransformPivotTarget()()` Get the view to pivot around |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#getView()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#interpolate(androidx.constraintlayout.core.motion.MotionWidget,float,long,androidx.constraintlayout.core.motion.utils.KeyCache)( child: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!, globalPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, time: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, keyCache: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/KeyCache! )` The main driver of interpolation |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setDrawPath(int)(debugMode: 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/motion/Motion#setEnd(androidx.constraintlayout.core.motion.MotionWidget)(mw: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setIdString(java.lang.String)(stringId: 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/motion/Motion#setPathMotionArc(int)(arc: 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/motion/Motion#setStaggerOffset(float)(staggerOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` set the offset used in calculating stagger launches |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setStaggerScale(float)(staggerScale: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Set stagger scale |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setStart(androidx.constraintlayout.core.motion.MotionWidget)(mw: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setStartState(androidx.constraintlayout.core.motion.utils.ViewState,androidx.constraintlayout.core.motion.MotionWidget,int,int,int)( rect: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/ViewState!, v: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!, rotation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, preWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, preHeight: 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/motion/Motion#setTransformPivotTarget(int)(transformPivotTarget: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set a view to pivot around |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setValue(int,boolean)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Used to set boolean values |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setValue(int,float)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Used to set float values |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setValue(int,int)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Used to set integer values |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setValue(int,java.lang.String)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Used to set String values |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setView(androidx.constraintlayout.core.motion.MotionWidget)(view: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setup(int,int,float,long)( parentWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, parentHeight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, transitionDuration: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, currentTime: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Called after all TimePoints \&Cycles have been added; Spines are evaluated |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#setupRelative(androidx.constraintlayout.core.motion.Motion)(motionController: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion!)` set up the motion to be relative to this other motionController |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#toString()()` Debug string |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/Motion#mId()` |

### Inherited Constants

From [androidx.constraintlayout.core.motion.utils.TypedValues](https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#BOOLEAN_MASK() = 1` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#FLOAT_MASK() = 4` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#INT_MASK() = 2` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#STRING_MASK() = 8` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#S_CUSTOM() = "CUSTOM"` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#TYPE_FRAME_POSITION() = 100` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/TypedValues#TYPE_TARGET() = 101`

## Constants

### DRAW_PATH_AS_CONFIGURED

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

```
const val DRAW_PATH_AS_CONFIGURED = 4: Int
```

### DRAW_PATH_BASIC

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

```
const val DRAW_PATH_BASIC = 1: Int
```

### DRAW_PATH_CARTESIAN

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

```
const val DRAW_PATH_CARTESIAN = 3: Int
```

### DRAW_PATH_NONE

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

```
const val DRAW_PATH_NONE = 0: Int
```

### DRAW_PATH_RECTANGLE

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

```
const val DRAW_PATH_RECTANGLE = 5: Int
```

### DRAW_PATH_RELATIVE

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

```
const val DRAW_PATH_RELATIVE = 2: Int
```

### DRAW_PATH_SCREEN

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

```
const val DRAW_PATH_SCREEN = 6: Int
```

### HORIZONTAL_PATH_X

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

```
const val HORIZONTAL_PATH_X = 2: Int
```

### HORIZONTAL_PATH_Y

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

```
const val HORIZONTAL_PATH_Y = 3: Int
```

### PATH_PERCENT

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

```
const val PATH_PERCENT = 0: Int
```

### PATH_PERPENDICULAR

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

```
const val PATH_PERPENDICULAR = 1: Int
```

### ROTATION_LEFT

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

```
const val ROTATION_LEFT = 2: Int
```

### ROTATION_RIGHT

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

```
const val ROTATION_RIGHT = 1: Int
```

### VERTICAL_PATH_X

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

```
const val VERTICAL_PATH_X = 4: Int
```

### VERTICAL_PATH_Y

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

```
const val VERTICAL_PATH_Y = 5: Int
```

## Public constructors

### Motion

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

```
Motion(view: MotionWidget!)
```

## Public functions

### addKey

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

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

### buildKeyFrames

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

```
fun buildKeyFrames(
    keyFrames: FloatArray<Float>!,
    mode: IntArray<Int>!,
    pos: IntArray<Int>!
): Int
```

### buildPath

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

```
fun buildPath(points: FloatArray<Float>!, pointCount: Int): Unit
```

Fills the array point with the center coordinates. point\[0\] is filled with the x coordinate of "time" 0.0 mPoints\[point.length-1\] is filled with the y coordinate of "time" 1.0

| Parameters |
|---|---|
| `points: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | array to fill (should be 2x the number of mPoints |

### buildRect

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

```
fun buildRect(p: Float, path: FloatArray<Float>!, offset: Int): Unit
```

### getAnimateRelativeTo

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

```
fun getAnimateRelativeTo(): String!
```

Returns the id of the view to move relative to. The position at the start and then end will be viewed relative to this view -1 is the return value if NOT in polar mode

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | the view id of the view this is in polar mode to or -1 if not in polar |

### getCenter

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

```
fun getCenter(p: Double, pos: FloatArray<Float>!, vel: FloatArray<Float>!): Unit
```

### getCenterX

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

```
fun getCenterX(): Float
```

### getCenterY

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

```
fun getCenterY(): Float
```

### getDpDt

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

```
fun getDpDt(
    position: Float,
    locationX: Float,
    locationY: Float,
    mAnchorDpDt: FloatArray<Float>!
): Unit
```

This returns the differential with respect to the animation layout position (Progress) of a point on the view (post layout effects are not computed)

| Parameters |
|---|---|
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | position in time |
| `locationX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the x location on the view (0 = left edge, 1 = right edge) |
| `locationY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the y location on the view (0 = top, 1 = bottom) |
| `mAnchorDpDt: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | returns the differential of the motion with respect to the position |

### getDrawPath

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

```
fun getDrawPath(): Int
```

### getFinalHeight

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

```
fun getFinalHeight(): Float
```

get the width of the widget at the end of the movement.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the height at the end |

### getFinalWidth

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

```
fun getFinalWidth(): Float
```

get the width of the widget at the end of the movement.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the width at the end |

### getFinalX

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

```
fun getFinalX(): Float
```

get the left most position of the widget at the end of the movement.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the left most position |

### getFinalY

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

```
fun getFinalY(): Float
```

get the top most position of the widget at the end of the movement. Positive is down.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the top most position |

### getId

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

```
fun getId(name: String!): Int
```

### getKeyFrame

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

```
fun getKeyFrame(i: Int): MotionPaths!
```

provides access to MotionPath objects

### getKeyFrameInfo

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

```
fun getKeyFrameInfo(type: Int, info: IntArray<Int>!): Int
```

Gets the keyFrames for the view controlled by this MotionController. The info data structure is of the form 0 length if your are at index i the \[i+len+1\] is the next entry 1 type 1=Attributes, 2=Position, 3=TimeCycle 4=Cycle 5=Trigger 2 position 3 x location 4 y location 5 ... length

| Parameters |
|---|---|
| `info: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` | is a data structure array of int that holds info on each keyframe |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Number of keyFrames found |

### getKeyFramePositions

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

```
fun getKeyFramePositions(type: IntArray<Int>!, pos: FloatArray<Float>!): Int
```

Get the keyFrames for the view controlled by this MotionController

| Parameters |
|---|---|
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` | is position(0-100) + 1000 \* mType(1=Attributes, 2=Position, 3=TimeCycle 4=Cycle 5=Trigger |
| `pos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | the x\&y position of the keyFrame along the path |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Number of keyFrames found |

### getMotionStagger

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

```
fun getMotionStagger(): Float
```

The values set in motion: { stagger: '2' }

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | value from motion: { stagger: ? } or NaN if not set |

### getStartHeight

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

```
fun getStartHeight(): Float
```

get the width of the widget at the start of the movement.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the height at the start |

### getStartWidth

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

```
fun getStartWidth(): Float
```

get the width of the widget at the start of the movement.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the width at the start |

### getStartX

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

```
fun getStartX(): Float
```

get the left most position of the widget at the start of the movement.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the left most position |

### getStartY

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

```
fun getStartY(): Float
```

get the top most position of the widget at the start of the movement. Positive is down.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the top most position |

### getTransformPivotTarget

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

```
fun getTransformPivotTarget(): Int
```

Get the view to pivot around

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | id of view or UNSET if not set |

### getView

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

```
fun getView(): MotionWidget!
```

### interpolate

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

```
fun interpolate(
    child: MotionWidget!,
    globalPosition: Float,
    time: Long,
    keyCache: KeyCache!
): Boolean
```

The main driver of interpolation

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | do you need to keep animating |

### setDrawPath

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

```
fun setDrawPath(debugMode: Int): Unit
```

### setEnd

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

```
fun setEnd(mw: MotionWidget!): Unit
```

### setIdString

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

```
fun setIdString(stringId: String!): Unit
```

### setPathMotionArc

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

```
fun setPathMotionArc(arc: Int): Unit
```

### setStaggerOffset

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

```
fun setStaggerOffset(staggerOffset: Float): Unit
```

set the offset used in calculating stagger launches

| Parameters |
|---|---|
| `staggerOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | fraction of progress before this controller runs |

### setStaggerScale

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

```
fun setStaggerScale(staggerScale: Float): Unit
```

Set stagger scale

### setStart

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

```
fun setStart(mw: MotionWidget!): Unit
```

### setStartState

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

```
fun setStartState(
    rect: ViewState!,
    v: MotionWidget!,
    rotation: Int,
    preWidth: Int,
    preHeight: Int
): Unit
```

### setTransformPivotTarget

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

```
fun setTransformPivotTarget(transformPivotTarget: Int): Unit
```

Set a view to pivot around

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

### setValue

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

```
fun setValue(id: Int, value: Boolean): Boolean
```

Used to set boolean values

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if it accepted the value |

### setValue

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

```
fun setValue(id: Int, value: Float): Boolean
```

Used to set float values

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if it accepted the value |

### setValue

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

```
fun setValue(id: Int, value: Int): Boolean
```

Used to set integer values

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if it accepted the value |

### setValue

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

```
fun setValue(id: Int, value: String!): Boolean
```

Used to set String values

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if it accepted the value |

### setView

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

```
fun setView(view: MotionWidget!): Unit
```

### setup

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

```
fun setup(
    parentWidth: Int,
    parentHeight: Int,
    transitionDuration: Float,
    currentTime: Long
): Unit
```

Called after all TimePoints \&Cycles have been added; Spines are evaluated

### setupRelative

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

```
fun setupRelative(motionController: Motion!): Unit
```

set up the motion to be relative to this other motionController

### toString

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

Debug string

## Public properties

### mId

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

```
val mId: String!
```