# DesignTool

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

*** ** * ** ***

<br />

```
class DesignTool
```

<br />

*** ** * ** ***

Utility class to manipulate MotionLayout from the layout editor

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#DesignTool(androidx.constraintlayout.motion.widget.MotionLayout)(motionLayout: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionLayout!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#designAccess(int,java.lang.String,java.lang.Object,float[],int,float[],int)( cmd: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, viewObject: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, in: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!, inLength: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, out: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!, outLength: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` This is a general access to systems in the MotionLayout System This provides a series of commands used by the designer to access needed logic It is written this way to minimize the interface between the library and designer. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#disableAutoTransition(boolean)(disable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` this allow disabling autoTransitions to prevent design surface from being in undefined states |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#dumpConstraintSet(java.lang.String)(set: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getAnimationKeyFrames(java.lang.Object,float[])(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, key: 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 location of the start end and key frames |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getAnimationPath(java.lang.Object,float[],int)(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/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>!, len: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Get the center point of the animation path of a view |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getAnimationRectangles(java.lang.Object,float[])(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/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>!)` Get the center point of the animation path of a view |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getEndState()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getKeyFrameInfo(java.lang.Object,int,int[])(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, 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>!)` 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/motion/widget/DesignTool#getKeyFramePosition(java.lang.Object,int,float,float)(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getKeyFramePositions(java.lang.Object,int[],float[])( view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, 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/-any/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getKeyframe(int,int,int)(type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, target: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getKeyframe(java.lang.Object,int,int)(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getKeyframeAtLocation(java.lang.Object,float,float)(viewObject: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getPositionKeyframe(java.lang.Object,java.lang.Object,float,float,java.lang.String[],float[])( keyFrame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, attribute: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!, value: 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/motion/widget/DesignTool#getProgress()()` Return the current progress of the current transition |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getStartState()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getState()()` Return the current state (ConstraintSet id) as a string |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#getTransitionTimeMs()()` Gets the time of the currently set animation. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#isInTransition()()` Utility method, returns true if we are currently in a transition |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#setAttributes(int,java.lang.String,java.lang.Object,java.lang.Object)( dpi: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, constraintSetId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, opaqueView: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, opaqueAttributes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html! )` Live setting of attributes on a view |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#setKeyFrame(java.lang.Object,int,java.lang.String,java.lang.Object)(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#setKeyFramePosition(java.lang.Object,int,int,float,float)(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Move the widget directly |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#setKeyframe(java.lang.Object,java.lang.String,java.lang.Object)(keyFrame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#setState(java.lang.String)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` This sets the constraint set based on a string. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#setToolPosition(float)(position: 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/motion/widget/DesignTool#setTransition(java.lang.String,java.lang.String)(start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` This sets the constraint set based on a string. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/DesignTool#setViewDebug(java.lang.Object,int)(view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, debugMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

## Public constructors

### DesignTool

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

```
DesignTool(motionLayout: MotionLayout!)
```

## Public functions

### designAccess

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

```
fun designAccess(
    cmd: Int,
    type: String!,
    viewObject: Any!,
    in: FloatArray<Float>!,
    inLength: Int,
    out: FloatArray<Float>!,
    outLength: Int
): Int
```

This is a general access to systems in the MotionLayout System This provides a series of commands used by the designer to access needed logic It is written this way to minimize the interface between the library and designer. It allows the logic to be kept only in the library not replicated in the gui builder. It also allows us to understand understand the version of MotionLayout in use commands 0 return the version number 1 Get the center point of the animation path of a view 2 Get the location of the start end and key frames

| Parameters |
|---|---|
| `cmd: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | this provide the command needed |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | support argument for command |
| `viewObject: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | if this command references a view this provides access |
| `in: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | this allows for an array of float to be the input to the system |
| `inLength: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | this provides the length of the input |
| `out: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | this provide the output array |
| `outLength: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the length of the output array |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | command dependent -1 is typically an error (do not understand) |

### disableAutoTransition

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

```
fun disableAutoTransition(disable: Boolean): Unit
```

this allow disabling autoTransitions to prevent design surface from being in undefined states

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

### dumpConstraintSet

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

```
fun dumpConstraintSet(set: String!): Unit
```

| Parameters |
|---|---|
| `set: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### getAnimationKeyFrames

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

```
fun getAnimationKeyFrames(view: Any!, key: FloatArray<Float>!): Int
```

Get the location of the start end and key frames

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | the view to track |
| `key: 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 be filled |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | number of key frames + 2 |

### getAnimationPath

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

```
fun getAnimationPath(view: Any!, path: FloatArray<Float>!, len: Int): Int
```

Get the center point of the animation path of a view

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | view to getMap the animation of |
| `path: 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 be filled (x1,y1,x2,y2...) |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | -1 if not under and animation 0 if not animated or number of point along animation |

### getAnimationRectangles

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

```
fun getAnimationRectangles(view: Any!, path: FloatArray<Float>!): Unit
```

Get the center point of the animation path of a view

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | view to getMap the animation of |
| `path: 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 be filled (in groups of 8) (x1,y1,x2,y2...) |

### getEndState

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

```
fun getEndState(): String!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### getKeyFrameInfo

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

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

Get the keyFrames for the view controlled by this MotionController. The call is designed to be efficient because it will be called 30x Number of views a second

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | the view to return keyframe positions |
| `info: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` |   |

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

### getKeyFramePosition

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

```
fun getKeyFramePosition(view: Any!, type: Int, x: Float, y: Float): Float
```

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |
| `x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` |   |
| `y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` |   |

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

### getKeyFramePositions

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

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

Get the keyFrames for the view controlled by this MotionController. The call is designed to be efficient because it will be called 30x Number of views a second

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | the view to return keyframe positions |
| `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 pos(0-100) + 1000\*mType(1=Attrib, 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 |

### getKeyframe

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

```
fun getKeyframe(type: Int, target: Int, position: Int): Any!
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |

### getKeyframe

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

```
fun getKeyframe(view: Any!, type: Int, position: Int): Any!
```

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |

### getKeyframeAtLocation

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

```
fun getKeyframeAtLocation(viewObject: Any!, x: Float, y: Float): Any!
```

| Parameters |
|---|---|
| `viewObject: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` |   |
| `y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |

### getPositionKeyframe

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

```
fun getPositionKeyframe(
    keyFrame: Any!,
    view: Any!,
    x: Float,
    y: Float,
    attribute: Array<String!>!,
    value: FloatArray<Float>!
): Boolean!
```

| Parameters |
|---|---|
| `keyFrame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` |   |
| `y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` |   |
| `attribute: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` |   |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html!` |   |

### getProgress

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

```
fun getProgress(): Float
```

Return the current progress of the current transition

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | current transition's progress |

### getStartState

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

```
fun getStartState(): String!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### getState

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

```
fun getState(): String!
```

Return the current state (ConstraintSet id) as a string

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | the last state set via the design tool bridge |

### getTransitionTimeMs

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

```
fun getTransitionTimeMs(): Long
```

Gets the time of the currently set animation.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | time in Milliseconds |

### isInTransition

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

```
fun isInTransition(): Boolean
```

Utility method, returns true if we are currently in a transition

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if in a transition, false otherwise |

### setAttributes

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

```
fun setAttributes(
    dpi: Int,
    constraintSetId: String!,
    opaqueView: Any!,
    opaqueAttributes: Any!
): Unit
```

Live setting of attributes on a view

| Parameters |
|---|---|
| `dpi: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | dpi used by the application |
| `constraintSetId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | ConstraintSet id |
| `opaqueView: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | the Android View we operate on, passed as an Object |
| `opaqueAttributes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` | the list of attributes (hash) we pass to the view |

### setKeyFrame

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

```
fun setKeyFrame(view: Any!, position: Int, name: String!, value: Any!): Unit
```

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |

### setKeyFramePosition

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

```
fun setKeyFramePosition(view: Any!, position: Int, type: Int, x: Float, y: Float): Boolean
```

Move the widget directly

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `position: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |
| `type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |
| `x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` |   |
| `y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` |   |

### setKeyframe

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

```
fun setKeyframe(keyFrame: Any!, tag: String!, value: Any!): Unit
```

| Parameters |
|---|---|
| `keyFrame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |

### setState

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

```
fun setState(id: String!): Unit
```

This sets the constraint set based on a string. (without the "@+id/")

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

### setToolPosition

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

```
fun setToolPosition(position: Float): Unit
```

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

### setTransition

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

```
fun setTransition(start: String!, end: String!): Unit
```

This sets the constraint set based on a string. (without the "@+id/")

| Parameters |
|---|---|
| `start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |
| `end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### setViewDebug

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

```
fun setViewDebug(view: Any!, debugMode: Int): Unit
```

| Parameters |
|---|---|
| `view: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |
| `debugMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |