# ConstraintLayoutStates

Artifact: [androidx.constraintlayout:constraintlayout](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/widget/ConstraintLayoutStates.java+class:androidx.constraintlayout.widget.ConstraintLayoutStates) Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

*** ** * ** ***


```
class ConstraintLayoutStates
```

<br />

*** ** * ** ***

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/widget/ConstraintLayoutStates#TAG() = "ConstraintLayoutStates"` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/widget/ConstraintLayoutStates#needsToChange(int,float,float)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Return true if it needs to change |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/widget/ConstraintLayoutStates#setOnConstraintsChanged(androidx.constraintlayout.widget.ConstraintsChangedListener)( constraintsChangedListener: https://developer.android.com/reference/kotlin/androidx/constraintlayout/widget/ConstraintsChangedListener! )` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/widget/ConstraintLayoutStates#updateConstraints(int,float,float)(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` updateConstraints for the view with the id and width and height |

## Constants

### TAG

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

```
const val TAG = "ConstraintLayoutStates": String!
```

## Public functions

### needsToChange

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

```
fun needsToChange(id: Int, width: Float, height: Float): Boolean
```

Return true if it needs to change

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

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

### setOnConstraintsChanged

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

```
fun setOnConstraintsChanged(
    constraintsChangedListener: ConstraintsChangedListener!
): Unit
```

### updateConstraints

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

```
fun updateConstraints(id: Int, width: Float, height: Float): Unit
```

updateConstraints for the view with the id and width and height

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