# ChainReference

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

*** ** * ** ***

<br />

```
public class ChainReference extends HelperReference
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.constraintlayout.core.state.ConstraintReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference) |||
|   | ↳ | [androidx.constraintlayout.core.state.HelperReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference) ||
|   |   | ↳ | [androidx.constraintlayout.core.state.helpers.ChainReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference) |

Known direct subclasses [HorizontalChainReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/HorizontalChainReference), [VerticalChainReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/VerticalChainReference)

|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/HorizontalChainReference` |   |
| `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/VerticalChainReference` |   |

*** ** * ** ***

`https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference` for Chains. Elements should be added with `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#addChainElement(java.lang.String,float,float,float)`

## Summary

| ### Protected fields |
|---|---|
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#mBias()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/HashMap.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#mMapPostMargin()` **This field is deprecated.** Unintended visibility, use `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getPostMargin(java.lang.String)` instead <br /> |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/HashMap.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#mMapPreMargin()` **This field is deprecated.** Unintended visibility, use `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getPreMargin(java.lang.String)` instead <br /> |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/HashMap.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#mMapWeights()` **This field is deprecated.** Unintended visibility, use `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getWeight(java.lang.String)` instead <br /> |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/State.Chain` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#mStyle()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#ChainReference(androidx.constraintlayout.core.state.State,androidx.constraintlayout.core.state.State.Helper)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/State state, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/State.Helper type)` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#addChainElement(java.lang.String,float,float,float)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id, float weight, float preMargin, float postMargin )` Adds the element by the given id to the Chain. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#bias(float)(float bias)` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getBias()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/State.Chain` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getStyle()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#style(androidx.constraintlayout.core.state.State.Chain)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/State.Chain style)` Sets the `https://developer.android.com/reference/androidx/constraintlayout/core/state/State.Chain`. |

| ### Protected methods |
|---|---|
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getPostMargin(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id)` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getPreMargin(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id)` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getWeight(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id)` |

### Inherited fields

From [androidx.constraintlayout.core.state.ConstraintReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference) `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mBottomToBottom()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mBottomToTop()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mEndToEnd()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mEndToStart()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mHorizontalBias()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mLeftToLeft()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mLeftToRight()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginBottom()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginBottomGone()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginEnd()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginEndGone()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginLeft()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginLeftGone()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginRight()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginRightGone()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginStart()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginStartGone()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginTop()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mMarginTopGone()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mRightToLeft()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mRightToRight()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mStartToEnd()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mStartToStart()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mTopToBottom()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mTopToTop()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#mVerticalBias()` From [androidx.constraintlayout.core.state.HelperReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference) `final https://developer.android.com/reference/androidx/constraintlayout/core/state/State` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#mHelperState()` `https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/java/lang/Object.html>` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#mReferences()`

### Inherited methods

From [androidx.constraintlayout.core.state.ConstraintReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference) `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#addCustomColor(java.lang.String,int)(https://developer.android.com/reference/java/lang/String.html name, int color)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#addCustomFloat(java.lang.String,float)(https://developer.android.com/reference/java/lang/String.html name, float value)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#alpha(float)(float alpha)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#applyWidgetConstraints()()`

apply all the constraints attributes of the mConstraintWidget
`https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#baseline()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#baselineToBaseline(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#baselineToBottom(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#baselineToTop(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#bottom()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#bottomToBottom(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#bottomToTop(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#centerHorizontally(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#centerVertically(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#circularConstraint(java.lang.Object,float,float)(https://developer.android.com/reference/java/lang/Object.html reference, float angle, float distance)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#clear()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#clearAll()()`

Clears all constraints.
`https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#clearHorizontal()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#clearVertical()()` `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#createConstraintWidget()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#end()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#endToEnd(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#endToStart(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getAlpha()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/Facade` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getFacade()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/Dimension` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getHeight()()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getHorizontalChainStyle()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getHorizontalChainWeight()()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getKey()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getPivotX()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getPivotY()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getRotationX()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getRotationY()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getRotationZ()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getScaleX()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getScaleY()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getTag()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getTranslationX()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getTranslationY()()` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getTranslationZ()()` `int` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getVerticalChainStyle(int)(int chainStyle)` `float` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getVerticalChainWeight()()` `https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getView()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/Dimension` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#getWidth()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#height(androidx.constraintlayout.core.state.Dimension)(https://developer.android.com/reference/androidx/constraintlayout/core/state/Dimension dimension)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#horizontalBias(float)(float value)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#left()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#leftToLeft(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#leftToRight(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#margin(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html marginValue)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#margin(int)(int value)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#marginGone(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html marginGoneValue)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#marginGone(int)(int value)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#pivotX(float)(float x)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#pivotY(float)(float y)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#right()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#rightToLeft(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#rightToRight(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#rotationX(float)(float x)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#rotationY(float)(float y)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#rotationZ(float)(float z)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#scaleX(float)(float x)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#scaleY(float)(float y)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setConstraintWidget(androidx.constraintlayout.core.widgets.ConstraintWidget)(https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget widget)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setFacade(androidx.constraintlayout.core.state.helpers.Facade)(https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/Facade facade)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setHeight(androidx.constraintlayout.core.state.Dimension)(https://developer.android.com/reference/androidx/constraintlayout/core/state/Dimension dimension)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setHorizontalChainStyle(int)(int chainStyle)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setHorizontalChainWeight(float)(float weight)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setKey(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html key)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setTag(java.lang.String)(https://developer.android.com/reference/java/lang/String.html tag)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setVerticalChainStyle(int)(int chainStyle)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setVerticalChainWeight(float)(float weight)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setView(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html view)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#setWidth(androidx.constraintlayout.core.state.Dimension)(https://developer.android.com/reference/androidx/constraintlayout/core/state/Dimension dimension)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#start()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#startToEnd(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#startToStart(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#top()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#topToBottom(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#topToTop(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html reference)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#translationX(float)(float x)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#translationY(float)(float y)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#translationZ(float)(float z)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#validate()()`

Validate the constraints
`https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#verticalBias(float)(float value)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#visibility(int)(int visibility)` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/ConstraintReference#width(androidx.constraintlayout.core.state.Dimension)(https://developer.android.com/reference/androidx/constraintlayout/core/state/Dimension dimension)` From [androidx.constraintlayout.core.state.HelperReference](https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference) `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#add(java.lang.Object...)(Object[] objects)` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#apply()()` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#applyBase()()`

Allows the derived classes to invoke the apply method in the ConstraintReference
`https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#getConstraintWidget()()` `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/HelperWidget` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#getHelperWidget()()` `https://developer.android.com/reference/androidx/constraintlayout/core/state/State.Helper` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#getType()()` `void` `https://developer.android.com/reference/androidx/constraintlayout/core/state/HelperReference#setHelperWidget(androidx.constraintlayout.core.widgets.HelperWidget)(https://developer.android.com/reference/androidx/constraintlayout/core/widgets/HelperWidget helperWidget)`

## Protected fields

### mBias

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

```
protected float mBias
```

### mMapPostMargin

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

```
protected @NonNull HashMap<String, Float> mMapPostMargin
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Unintended visibility, use `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getPostMargin(java.lang.String)` instead

### mMapPreMargin

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

```
protected @NonNull HashMap<String, Float> mMapPreMargin
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Unintended visibility, use `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getPreMargin(java.lang.String)` instead

### mMapWeights

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

```
protected @NonNull HashMap<String, Float> mMapWeights
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Unintended visibility, use `https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference#getWeight(java.lang.String)` instead

### mStyle

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

```
protected @NonNull State.Chain mStyle
```

## Public constructors

### ChainReference

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

```
public ChainReference(@NonNull State state, @NonNull State.Helper type)
```

## Public methods

### addChainElement

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

```
public void addChainElement(
    @NonNull String id,
    float weight,
    float preMargin,
    float postMargin
)
```

Adds the element by the given id to the Chain. The order in which the elements are added is important. It will represent the element's position in the Chain.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id` | Id of the element to add |
| `float weight` | Weight used to distribute remaining space to each element |
| `float preMargin` | Additional space in pixels between the added element and the previous one (if any) |
| `float postMargin` | Additional space in pixels between the added element and the next one (if any) |

### bias

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

```
public @NonNull ChainReference bias(float bias)
```

### getBias

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

```
public float getBias()
```

### getStyle

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

```
public @NonNull State.Chain getStyle()
```

### style

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

```
public @NonNull ChainReference style(@NonNull State.Chain style)
```

Sets the `https://developer.android.com/reference/androidx/constraintlayout/core/state/State.Chain`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/State.Chain style` | Defines the way the chain will lay out its elements |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/constraintlayout/core/state/helpers/ChainReference` | This same instance |

## Protected methods

### getPostMargin

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

```
protected float getPostMargin(@NonNull String id)
```

### getPreMargin

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

```
protected float getPreMargin(@NonNull String id)
```

### getWeight

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

```
protected float getWeight(@NonNull String id)
```