# ConstraintsChangedListener

Summary:[Ctors](https://developer.android.com/reference/android/support/constraint/ConstraintsChangedListener#pubctors)\|[Methods](https://developer.android.com/reference/android/support/constraint/ConstraintsChangedListener#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/constraint/ConstraintsChangedListener#inhmethods)  

# ConstraintsChangedListener

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The Constraint Layout support library has been superseded by the[AndroidX Constraint Layout library](https://developer.android.com/reference/androidx/constraintlayout/classes), which is part of[Jetpack](https://developer.android.com/jetpack). The`ConstraintsChangedListener`class has been superseded by[`androidx.constraintlayout.widget.ConstraintsChangedListener`](https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintsChangedListener). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX.

`
public


abstract
class
ConstraintsChangedListener
`  
`

extends Object


``


`

|---|-------------------------------------------------------|
| java.lang.Object                                         ||
| ↳ | android.support.constraint.ConstraintsChangedListener |

<br />

*** ** * ** ***

**Added in 2.0**

Callbacks on state change

<br />

## Summary

|                                                                       ### Public constructors                                                                       ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ConstraintsChangedListener](https://developer.android.com/reference/android/support/constraint/ConstraintsChangedListener#ConstraintsChangedListener())`() ` |

|                                                                                                    ### Public methods                                                                                                    ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[postLayoutChange](https://developer.android.com/reference/android/support/constraint/ConstraintsChangedListener#postLayoutChange(int,%20int))`(int stateId, int constraintId) ` called after layout happens |
| ` void` | ` `[preLayoutChange](https://developer.android.com/reference/android/support/constraint/ConstraintsChangedListener#preLayoutChange(int,%20int))`(int stateId, int constraintId) ` called before layout happens  |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### ConstraintsChangedListener

```
public ConstraintsChangedListener ()
```

<br />

<br />

## Public methods

### postLayoutChange

```
public void postLayoutChange (int stateId, 
                int constraintId)
```

called after layout happens

<br />

|                                   Parameters                                   ||
|----------------|----------------------------------------------------------------|
| `stateId`      | `int`: -1 if state unknown, otherwise the current state <br /> |
| `constraintId` | `int`: the current constraintSet id we transitioned to <br />  |

### preLayoutChange

```
public void preLayoutChange (int stateId, 
                int constraintId)
```

called before layout happens

<br />

|                                          Parameters                                          ||
|----------------|------------------------------------------------------------------------------|
| `stateId`      | `int`: -1 if state unknown, otherwise the state we will transition to <br /> |
| `constraintId` | `int`: the constraintSet id that we will transition to <br />                |