# Chain

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

*** ** * ** ***


```
class Chain
```

<br />

*** ** * ** ***

Chain management and constraints creation

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/Chain#USE_CHAIN_OPTIMIZATION() = false` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/Chain#Chain()()` |

| ### Public functions |
|---|---|
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/Chain#applyChainConstraints(androidx.constraintlayout.core.widgets.ConstraintWidgetContainer,androidx.constraintlayout.core.LinearSystem,java.util.ArrayList<androidx.constraintlayout.core.widgets.ConstraintWidget>,int)( constraintWidgetContainer: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer!, system: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/LinearSystem!, widgets: https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidget!>!, orientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Apply specific rules for dealing with chains of widgets. |

## Constants

### USE_CHAIN_OPTIMIZATION

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

```
const val USE_CHAIN_OPTIMIZATION = false: Boolean
```

## Public constructors

### Chain

Added in 1.1.2

```
Chain()
```

## Public functions

### applyChainConstraints

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

```
java-static fun applyChainConstraints(
    constraintWidgetContainer: ConstraintWidgetContainer!,
    system: LinearSystem!,
    widgets: ArrayList<ConstraintWidget!>!,
    orientation: Int
): Unit
```

Apply specific rules for dealing with chains of widgets. Chains are defined as a list of widget linked together with bi-directional connections

| Parameters |
|---|---|
| `constraintWidgetContainer: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer!` | root container |
| `system: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/LinearSystem!` | the linear system we add the equations to |
| `orientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | HORIZONTAL or VERTICAL |