# ConstraintWidget

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

*** ** * ** ***

<br />

```
public class ConstraintWidget
```

<br />

Known direct subclasses [Guideline](https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Guideline), [HelperWidget](https://developer.android.com/reference/androidx/constraintlayout/core/widgets/HelperWidget), [WidgetContainer](https://developer.android.com/reference/androidx/constraintlayout/core/widgets/WidgetContainer)

|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Guideline` | Guideline |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/HelperWidget` | HelperWidget class |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/WidgetContainer` | A container of ConstraintWidget |

Known indirect subclasses [Barrier](https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Barrier), [ConstraintWidgetContainer](https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer), [Flow](https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Flow), [GridCore](https://developer.android.com/reference/androidx/constraintlayout/core/utils/GridCore), [Placeholder](https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Placeholder), [VirtualLayout](https://developer.android.com/reference/androidx/constraintlayout/core/widgets/VirtualLayout)

|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Barrier` | A Barrier takes multiple widgets |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer` | A container of ConstraintWidget that can layout its children |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Flow` | Implements the Flow virtual layout. |
| `https://developer.android.com/reference/androidx/constraintlayout/core/utils/GridCore` | The Grid Helper in the Core library that helps to enable Grid in Compose |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Placeholder` | Simple VirtualLayout that center the first referenced widget onto itself. |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/VirtualLayout` | Base class for Virtual layouts |

*** ** * ** ***

Implements a constraint Widget model supporting constraints relations between other widgets.

The widget has various anchors (i.e. Left, Top, Right, Bottom, representing their respective sides, as well as Baseline, Center_X and Center_Y). Connecting anchors from one widget to another represents a constraint relation between the two anchors; the `https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem` will then be able to use this model to try to minimize the distances between connected anchors.

If opposite anchors are connected (e.g. Left and Right anchors), if they have the same strength, the widget will be equally pulled toward their respective target anchor positions; if the widget has a fixed size, this means that the widget will be centered between the two target anchors. If the widget's size is allowed to adjust, the size of the widget will change to be as large as necessary so that the widget's anchors and the target anchors' distances are zero.
Constraints are set by connecting a widget's anchor to another via the `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#connect(androidx.constraintlayout.core.widgets.ConstraintAnchor,androidx.constraintlayout.core.widgets.ConstraintAnchor,int)` function.

## Summary

| ### Nested types |
|---|
| `public enum https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` Define how the widget will resize |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ANCHOR_BASELINE() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ANCHOR_BOTTOM() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ANCHOR_LEFT() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ANCHOR_RIGHT() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ANCHOR_TOP() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#BOTH() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#CHAIN_PACKED() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#CHAIN_SPREAD() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#CHAIN_SPREAD_INSIDE() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#DIRECT() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#GONE() = 8` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#HORIZONTAL() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#INVISIBLE() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#MATCH_CONSTRAINT_PERCENT() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#MATCH_CONSTRAINT_RATIO() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#MATCH_CONSTRAINT_RATIO_RESOLVED() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#MATCH_CONSTRAINT_SPREAD() = 0` ///////////////////////////////////////////////////////////////////////////////////////////// |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#MATCH_CONSTRAINT_WRAP() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#SOLVER() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#UNKNOWN() = -1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#VERTICAL() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#VISIBLE() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#WRAP_BEHAVIOR_HORIZONTAL_ONLY() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#WRAP_BEHAVIOR_INCLUDED() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#WRAP_BEHAVIOR_SKIPPED() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#WRAP_BEHAVIOR_VERTICAL_ONLY() = 2` |

| ### Public fields |
|---|---|
| `static float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#DEFAULT_BIAS()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/state/WidgetFrame` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#frame()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/analyzer/ChainRun` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#horizontalChainRun()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#horizontalGroup()` ////////////////////////////////END SERIALIZE/////////////////////////////////////////// |
| `boolean[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isTerminalWidget()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mBaseline()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mBottom()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mCenter()` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mCircleConstraintAngle()` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mDimensionRatio()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mHorizontalResolution()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/analyzer/HorizontalWidgetRun` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mHorizontalRun()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mIsHeightWrapContent()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mIsWidthWrapContent()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mLeft()` |
| `ConstraintAnchor[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mListAnchors()` |
| `ConstraintWidget.DimensionBehaviour[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mListDimensionBehaviors()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMatchConstraintDefaultHeight()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMatchConstraintDefaultWidth()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMatchConstraintMaxHeight()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMatchConstraintMaxWidth()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMatchConstraintMinHeight()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMatchConstraintMinWidth()` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMatchConstraintPercentHeight()` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMatchConstraintPercentWidth()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mParent()` |
| `int[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mResolvedMatchConstraintDefault()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mRight()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mTop()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mVerticalResolution()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/analyzer/VerticalWidgetRun` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mVerticalRun()` |
| `float[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mWeight()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#measured()` ///////////////////////////////////////////////////////////////////////////////////////////// |
| `WidgetRun[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#run()` |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#stringId()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/analyzer/ChainRun` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#verticalChainRun()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#verticalGroup()` |

| ### Protected fields |
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor>` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mAnchors()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mDimensionRatioSide()` |
| `ConstraintWidget[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mListNextMatchConstraintsWidget()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMinHeight()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mMinWidth()` |
| `ConstraintWidget[]` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mNextChainWidget()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mOffsetX()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mOffsetY()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mX()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#mY()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ConstraintWidget()()` Default constructor |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ConstraintWidget(java.lang.String)(https://developer.android.com/reference/java/lang/String.html debugName)` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ConstraintWidget(int,int)(int width, int height)` Constructor |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ConstraintWidget(java.lang.String,int,int)(https://developer.android.com/reference/java/lang/String.html debugName, int width, int height)` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ConstraintWidget(int,int,int,int)(int x, int y, int width, int height)` Constructor |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ConstraintWidget(java.lang.String,int,int,int,int)(https://developer.android.com/reference/java/lang/String.html debugName, int x, int y, int width, int height)` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#addChildrenToSolverByDependency(androidx.constraintlayout.core.widgets.ConstraintWidgetContainer,androidx.constraintlayout.core.LinearSystem,java.util.HashSet<androidx.constraintlayout.core.widgets.ConstraintWidget>,int,boolean)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer container, https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system, https://developer.android.com/reference/java/util/HashSet.html<https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget> widgets, int orientation, boolean addSelf )` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#addToSolver(androidx.constraintlayout.core.LinearSystem,boolean)(https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system, boolean optimize)` Add this widget to the solver |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#allowedInBarrier()()` Returns true if this widget should be used in a barrier |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#connect(androidx.constraintlayout.core.widgets.ConstraintAnchor.Type,androidx.constraintlayout.core.widgets.ConstraintWidget,androidx.constraintlayout.core.widgets.ConstraintAnchor.Type)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type constraintFrom, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget target, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type constraintTo )` Connect a given anchor of this widget to another anchor of a target widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#connect(androidx.constraintlayout.core.widgets.ConstraintAnchor,androidx.constraintlayout.core.widgets.ConstraintAnchor,int)(https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor from, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor to, int margin)` Connect the given anchors together (the from anchor should be owned by this widget) |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#connect(androidx.constraintlayout.core.widgets.ConstraintAnchor.Type,androidx.constraintlayout.core.widgets.ConstraintWidget,androidx.constraintlayout.core.widgets.ConstraintAnchor.Type,int)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type constraintFrom, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget target, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type constraintTo, int margin )` Connect a given anchor of this widget to another anchor of a target widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#connectCircularConstraint(androidx.constraintlayout.core.widgets.ConstraintWidget,float,int)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget target, float angle, int radius )` Set a circular constraint |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#copy(androidx.constraintlayout.core.widgets.ConstraintWidget,java.util.HashMap<androidx.constraintlayout.core.widgets.ConstraintWidget,androidx.constraintlayout.core.widgets.ConstraintWidget>)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget src, https://developer.android.com/reference/java/util/HashMap.html<https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget> map )` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#createObjectVariables(androidx.constraintlayout.core.LinearSystem)(https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system)` Create all the system variables for this widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ensureMeasureRequested()()` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#ensureWidgetRuns()()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getAnchor(androidx.constraintlayout.core.widgets.ConstraintAnchor.Type)(https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type anchorType)` Given a type of anchor, returns the corresponding anchor. |
| `https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor>` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getAnchors()()` Return the array of anchors of this widget |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getBaselineDistance()()` Return the baseline distance relative to the top of the widget |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getBiasPercent(int)(int orientation)` Return the percentage bias that is used when two opposite connections exist of the same strength in a particular orientation. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getBottom()()` Return the bottom position of the widget |
| `https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getCompanionWidget()()` Return the companion widget. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getContainerItemSkip()()` Accessor for the skip value |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getDebugName()()` Returns the name of this widget (used for debug purposes) |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getDimensionBehaviour(int)(int orientation)` Get the widget's `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` in an specific orientation. |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getDimensionRatio()()` Return the current ratio of this widget |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getDimensionRatioSide()()` Return the current side on which ratio will be applied |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getHasBaseline()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getHeight()()` Return the height of the widget |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getHorizontalBiasPercent()()` Return the horizontal percentage bias that is used when two opposite connections exist of the same strength. |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getHorizontalChainControlWidget()()` if in a horizontal chain return the left most widget in the chain. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getHorizontalChainStyle()()` get the chain starting from this widget to be packed. |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getHorizontalDimensionBehaviour()()` Accessor for the horizontal dimension behaviour |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getHorizontalMargin()()` Returns all the horizontal margin of the widget. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getLastHorizontalMeasureSpec()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getLastVerticalMeasureSpec()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getLeft()()` Return the left position of the widget (similar to `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getX()`) |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getLength(int)(int orientation)` Get a dimension of the widget in a particular orientation. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getMaxHeight()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getMaxWidth()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getMinHeight()()` Return the minimum height of the widget |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getMinWidth()()` Return the minimum width of the widget |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getNextChainMember(int)(int orientation)` Return the next chain member if one exists |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getOptimizerWrapHeight()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getOptimizerWrapWidth()()` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getParent()()` Returns the parent of this widget if there is one |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getPreviousChainMember(int)(int orientation)` Return the previous chain member if one exists |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getRight()()` Return the right position of the widget |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/analyzer/WidgetRun` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getRun(int)(int orientation)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getSceneString(java.lang.StringBuilder)(https://developer.android.com/reference/java/lang/StringBuilder.html ret)` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getTop()()` Return the top position of the widget (similar to `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getY()`) |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getType()()` Returns the type string if set |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getVerticalBiasPercent()()` Return the vertical percentage bias that is used when two opposite connections exist of the same strength. |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getVerticalChainControlWidget()()` if in a vertical chain return the top most widget in the chain. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getVerticalChainStyle()()` Set the chain starting from this widget to be packed. |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getVerticalDimensionBehaviour()()` Accessor for the vertical dimension behaviour |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getVerticalMargin()()` Returns all the vertical margin of the widget |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getVisibility()()` Returns the current visibility value for this widget |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getWidth()()` Return the width of the widget |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getWrapBehaviorInParent()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getX()()` Return the x position of the widget, relative to its container |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getY()()` Return the y position of the widget, relative to its container |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#hasBaseline()()` Return true if this widget has a baseline |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#hasDanglingDimension(int)(int orientation)` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#hasDependencies()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#hasDimensionOverride()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#hasResolvedTargets(int,int)(int orientation, int size)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#immediateConnect(androidx.constraintlayout.core.widgets.ConstraintAnchor.Type,androidx.constraintlayout.core.widgets.ConstraintWidget,androidx.constraintlayout.core.widgets.ConstraintAnchor.Type,int,int)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type startType, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget target, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type endType, int margin, int goneMargin )` Immediate connection to an anchor without any checks. |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isAnimated()()` Returns if this widget is animated. |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isHeightWrapContent()()` Returns true if height is set to wrap_content |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isHorizontalSolvingPassDone()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isInBarrier(int)(int orientation)` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isInHorizontalChain()()` Test if you are in a Horizontal chain |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isInPlaceholder()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isInVerticalChain()()` Test if you are in a vertical chain |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isInVirtualLayout()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isMeasureRequested()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isResolvedHorizontally()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isResolvedVertically()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isRoot()()` Returns true if the widget is the root widget |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isSpreadHeight()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isSpreadWidth()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isVerticalSolvingPassDone()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#isWidthWrapContent()()` Returns true if width is set to wrap_content |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#markHorizontalSolvingPassDone()()` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#markVerticalSolvingPassDone()()` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#oppositeDimensionDependsOn(int)(int orientation)` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#oppositeDimensionsTied()()` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#reset()()` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#resetAllConstraints()()` Reset all the constraints set on this widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#resetAnchor(androidx.constraintlayout.core.widgets.ConstraintAnchor)(https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor anchor)` Reset the given anchor |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#resetAnchors()()` Reset all connections |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#resetFinalResolution()()` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#resetSolverVariables(androidx.constraintlayout.core.Cache)(https://developer.android.com/reference/androidx/constraintlayout/core/Cache cache)` Reset the solver variables of the anchors |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#resetSolvingPassFlag()()` |
| `https://developer.android.com/reference/java/lang/StringBuilder.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#serialize(java.lang.StringBuilder)(https://developer.android.com/reference/java/lang/StringBuilder.html ret)` Serialize the anchors for JSON5 output |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setAnimated(boolean)(boolean animated)` Set if this widget is animated. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setBaselineDistance(int)(int baseline)` Set the baseline distance relative to the top of the widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setCompanionWidget(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html companion)` Set the companion widget. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setContainerItemSkip(int)(int skip)` Set the skip value for this widget. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setDebugName(java.lang.String)(https://developer.android.com/reference/java/lang/String.html name)` Set the debug name of this widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setDebugSolverName(androidx.constraintlayout.core.LinearSystem,java.lang.String)(https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system, https://developer.android.com/reference/java/lang/String.html name)` Utility debug function. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setDimension(int,int)(int w, int h)` Set both width and height of the widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setDimensionRatio(java.lang.String)(https://developer.android.com/reference/java/lang/String.html ratio)` Set the ratio of the widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setDimensionRatio(float,int)(float ratio, int dimensionRatioSide)` Set the ratio of the widget The ratio will be applied if at least one of the dimension (width or height) is set to a behaviour of DimensionBehaviour.MATCH_CONSTRAINT -- the dimension's value will be set to the other dimension \* ratio. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setFinalBaseline(int)(int baselineValue)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setFinalFrame(int,int,int,int,int,int)( int left, int top, int right, int bottom, int baseline, int orientation )` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setFinalHorizontal(int,int)(int x1, int x2)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setFinalLeft(int)(int x1)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setFinalTop(int)(int y1)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setFinalVertical(int,int)(int y1, int y2)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setFrame(int,int,int)(int start, int end, int orientation)` Set the position+dimension of the widget based on starting/ending positions on one dimension. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setFrame(int,int,int,int)(int left, int top, int right, int bottom)` Set the position+dimension of the widget given left/top/right/bottom |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setGoneMargin(androidx.constraintlayout.core.widgets.ConstraintAnchor.Type,int)(https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type type, int goneMargin)` Set the margin to be used when connected to a widget with a visibility of GONE |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHasBaseline(boolean)(boolean hasBaseline)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHeight(int)(int h)` Set the height of the widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHeightWrapContent(boolean)(boolean heightWrapContent)` Keep track of wrap_content for height |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHorizontalBiasPercent(float)(float horizontalBiasPercent)` Set the horizontal bias percent to apply when we have two opposite constraints of equal strength |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHorizontalChainStyle(int)(int horizontalChainStyle)` Set the chain starting from this widget to be packed. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHorizontalDimension(int,int)(int left, int right)` Set the positions for the horizontal dimension only |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHorizontalDimensionBehaviour(androidx.constraintlayout.core.widgets.ConstraintWidget.DimensionBehaviour)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour behaviour )` Set the widget's behaviour for the horizontal dimension |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHorizontalMatchStyle(int,int,int,float)( int horizontalMatchStyle, int min, int max, float percent )` Set the horizontal style when MATCH_CONSTRAINT is set |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setHorizontalWeight(float)(float horizontalWeight)` Set the horizontal weight (only used in chains) |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setInPlaceholder(boolean)(boolean inPlaceholder)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setInVirtualLayout(boolean)(boolean inVirtualLayout)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setLastMeasureSpec(int,int)(int horizontal, int vertical)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setLength(int,int)(int length, int orientation)` Set the dimension of a widget in a particular orientation. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setMaxHeight(int)(int maxHeight)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setMaxWidth(int)(int maxWidth)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setMeasureRequested(boolean)(boolean measureRequested)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setMinHeight(int)(int h)` Set the minimum height of the widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setMinWidth(int)(int w)` Set the minimum width of the widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setOffset(int,int)(int x, int y)` Set the offset of this widget relative to the root widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setOrigin(int,int)(int x, int y)` Set both the origin in (x, y) of the widget, relative to its container |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setParent(androidx.constraintlayout.core.widgets.ConstraintWidget)(https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget widget)` Set the parent of this widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setType(java.lang.String)(https://developer.android.com/reference/java/lang/String.html type)` Set the type of the widget (as a String) |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setVerticalBiasPercent(float)(float verticalBiasPercent)` Set the vertical bias percent to apply when we have two opposite constraints of equal strength |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setVerticalChainStyle(int)(int verticalChainStyle)` Set the chain starting from this widget to be packed. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setVerticalDimension(int,int)(int top, int bottom)` Set the positions for the vertical dimension only |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setVerticalDimensionBehaviour(androidx.constraintlayout.core.widgets.ConstraintWidget.DimensionBehaviour)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour behaviour )` Set the widget's behaviour for the vertical dimension |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setVerticalMatchStyle(int,int,int,float)( int verticalMatchStyle, int min, int max, float percent )` Set the vertical style when MATCH_CONSTRAINT is set |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setVerticalWeight(float)(float verticalWeight)` Set the vertical weight (only used in chains) |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setVisibility(int)(int visibility)` Set the visibility for this widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setWidth(int)(int w)` Set the width of the widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setWidthWrapContent(boolean)(boolean widthWrapContent)` Keep track of wrap_content for width |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setWrapBehaviorInParent(int)(int behavior)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setX(int)(int x)` Set the x position of the widget, relative to its container |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setY(int)(int y)` Set the y position of the widget, relative to its container |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setupDimensionRatio(boolean,boolean,boolean,boolean)( boolean hParentWrapContent, boolean vParentWrapContent, boolean horizontalDimensionFixed, boolean verticalDimensionFixed )` Resolves the dimension ratio parameters (mResolvedDimensionRatioSide \&mDimensionRatio) |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#toString()()` Returns a string representation of the ConstraintWidget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#updateFromRuns(boolean,boolean)(boolean updateHorizontal, boolean updateVertical)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#updateFromSolver(androidx.constraintlayout.core.LinearSystem,boolean)(https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system, boolean optimize)` Update the widget from the values generated by the solver |

| ### Protected methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getRootX()()` Return the x position of the widget, relative to the root (without animation) |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getRootY()()` Return the y position of the widget, relative to the root (without animation) |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#setInBarrier(int,boolean)(int orientation, boolean value)` |

## Constants

### ANCHOR_BASELINE

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

```
public static final int ANCHOR_BASELINE = 4
```

### ANCHOR_BOTTOM

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

```
public static final int ANCHOR_BOTTOM = 3
```

### ANCHOR_LEFT

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

```
public static final int ANCHOR_LEFT = 0
```

### ANCHOR_RIGHT

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

```
public static final int ANCHOR_RIGHT = 1
```

### ANCHOR_TOP

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

```
public static final int ANCHOR_TOP = 2
```

### BOTH

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

```
public static final int BOTH = 2
```

### CHAIN_PACKED

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

```
public static final int CHAIN_PACKED = 2
```

### CHAIN_SPREAD

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

```
public static final int CHAIN_SPREAD = 0
```

### CHAIN_SPREAD_INSIDE

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

```
public static final int CHAIN_SPREAD_INSIDE = 1
```

### DIRECT

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

```
protected static final int DIRECT = 2
```

### GONE

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

```
public static final int GONE = 8
```

### HORIZONTAL

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

```
public static final int HORIZONTAL = 0
```

### INVISIBLE

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

```
public static final int INVISIBLE = 4
```

### MATCH_CONSTRAINT_PERCENT

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

```
public static final int MATCH_CONSTRAINT_PERCENT = 2
```

### MATCH_CONSTRAINT_RATIO

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

```
public static final int MATCH_CONSTRAINT_RATIO = 3
```

### MATCH_CONSTRAINT_RATIO_RESOLVED

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

```
public static final int MATCH_CONSTRAINT_RATIO_RESOLVED = 4
```

### MATCH_CONSTRAINT_SPREAD

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

```
public static final int MATCH_CONSTRAINT_SPREAD = 0
```

/////////////////////////////////////////////////////////////////////////////////////////////

### MATCH_CONSTRAINT_WRAP

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

```
public static final int MATCH_CONSTRAINT_WRAP = 1
```

### SOLVER

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

```
protected static final int SOLVER = 1
```

### UNKNOWN

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

```
public static final int UNKNOWN = -1
```

### VERTICAL

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

```
public static final int VERTICAL = 1
```

### VISIBLE

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

```
public static final int VISIBLE = 0
```

### WRAP_BEHAVIOR_HORIZONTAL_ONLY

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

```
public static final int WRAP_BEHAVIOR_HORIZONTAL_ONLY = 1
```

### WRAP_BEHAVIOR_INCLUDED

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

```
public static final int WRAP_BEHAVIOR_INCLUDED = 0
```

### WRAP_BEHAVIOR_SKIPPED

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

```
public static final int WRAP_BEHAVIOR_SKIPPED = 3
```

### WRAP_BEHAVIOR_VERTICAL_ONLY

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

```
public static final int WRAP_BEHAVIOR_VERTICAL_ONLY = 2
```

## Public fields

### DEFAULT_BIAS

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

```
public static float DEFAULT_BIAS
```

### frame

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

```
public WidgetFrame frame
```

### horizontalChainRun

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

```
public ChainRun horizontalChainRun
```

### horizontalGroup

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

```
public int horizontalGroup
```

////////////////////////////////END SERIALIZE///////////////////////////////////////////

### isTerminalWidget

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

```
public boolean[] isTerminalWidget
```

### mBaseline

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

```
public ConstraintAnchor mBaseline
```

### mBottom

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

```
public ConstraintAnchor mBottom
```

### mCenter

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

```
public ConstraintAnchor mCenter
```

### mCircleConstraintAngle

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

```
public float mCircleConstraintAngle
```

### mDimensionRatio

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

```
public float mDimensionRatio
```

### mHorizontalResolution

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

```
public int mHorizontalResolution
```

### mHorizontalRun

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

```
public HorizontalWidgetRun mHorizontalRun
```

### mIsHeightWrapContent

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

```
public boolean mIsHeightWrapContent
```

### mIsWidthWrapContent

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

```
public boolean mIsWidthWrapContent
```

### mLeft

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

```
public ConstraintAnchor mLeft
```

### mListAnchors

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

```
public ConstraintAnchor[] mListAnchors
```

### mListDimensionBehaviors

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

```
public ConstraintWidget.DimensionBehaviour[] mListDimensionBehaviors
```

### mMatchConstraintDefaultHeight

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

```
public int mMatchConstraintDefaultHeight
```

### mMatchConstraintDefaultWidth

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

```
public int mMatchConstraintDefaultWidth
```

### mMatchConstraintMaxHeight

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

```
public int mMatchConstraintMaxHeight
```

### mMatchConstraintMaxWidth

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

```
public int mMatchConstraintMaxWidth
```

### mMatchConstraintMinHeight

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

```
public int mMatchConstraintMinHeight
```

### mMatchConstraintMinWidth

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

```
public int mMatchConstraintMinWidth
```

### mMatchConstraintPercentHeight

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

```
public float mMatchConstraintPercentHeight
```

### mMatchConstraintPercentWidth

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

```
public float mMatchConstraintPercentWidth
```

### mParent

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

```
public ConstraintWidget mParent
```

### mResolvedMatchConstraintDefault

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

```
public int[] mResolvedMatchConstraintDefault
```

### mRight

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

```
public ConstraintAnchor mRight
```

### mTop

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

```
public ConstraintAnchor mTop
```

### mVerticalResolution

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

```
public int mVerticalResolution
```

### mVerticalRun

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

```
public VerticalWidgetRun mVerticalRun
```

### mWeight

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

```
public float[] mWeight
```

### measured

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

```
public boolean measured
```

/////////////////////////////////////////////////////////////////////////////////////////////

### run

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

```
public WidgetRun[] run
```

### stringId

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

```
public String stringId
```

### verticalChainRun

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

```
public ChainRun verticalChainRun
```

### verticalGroup

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

```
public int verticalGroup
```

## Protected fields

### mAnchors

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

```
protected ArrayList<ConstraintAnchor> mAnchors
```

### mDimensionRatioSide

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

```
protected int mDimensionRatioSide
```

### mListNextMatchConstraintsWidget

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

```
protected ConstraintWidget[] mListNextMatchConstraintsWidget
```

### mMinHeight

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

```
protected int mMinHeight
```

### mMinWidth

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

```
protected int mMinWidth
```

### mNextChainWidget

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

```
protected ConstraintWidget[] mNextChainWidget
```

### mOffsetX

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

```
protected int mOffsetX
```

### mOffsetY

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

```
protected int mOffsetY
```

### mX

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

```
protected int mX
```

### mY

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

```
protected int mY
```

## Public constructors

### ConstraintWidget

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

```
public ConstraintWidget()
```

Default constructor

### ConstraintWidget

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

```
public ConstraintWidget(String debugName)
```

### ConstraintWidget

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

```
public ConstraintWidget(int width, int height)
```

Constructor

| Parameters |
|---|---|
| `int width` | width of the layout |
| `int height` | height of the layout |

### ConstraintWidget

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

```
public ConstraintWidget(String debugName, int width, int height)
```

### ConstraintWidget

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

```
public ConstraintWidget(int x, int y, int width, int height)
```

Constructor

| Parameters |
|---|---|
| `int x` | x position |
| `int y` | y position |
| `int width` | width of the layout |
| `int height` | height of the layout |

### ConstraintWidget

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

```
public ConstraintWidget(String debugName, int x, int y, int width, int height)
```

## Public methods

### addChildrenToSolverByDependency

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

```
public void addChildrenToSolverByDependency(
    ConstraintWidgetContainer container,
    LinearSystem system,
    HashSet<ConstraintWidget> widgets,
    int orientation,
    boolean addSelf
)
```

### addToSolver

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

```
public void addToSolver(LinearSystem system, boolean optimize)
```

Add this widget to the solver

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system` | the solver we want to add the widget to |
| `boolean optimize` | true if `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Optimizer#OPTIMIZATION_GRAPH()` is on |

### allowedInBarrier

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

```
public boolean allowedInBarrier()
```

Returns true if this widget should be used in a barrier

### connect

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

```
public void connect(
    ConstraintAnchor.Type constraintFrom,
    ConstraintWidget target,
    ConstraintAnchor.Type constraintTo
)
```

Connect a given anchor of this widget to another anchor of a target widget

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type constraintFrom` | which anchor of this widget to connect from |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget target` | the target widget |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type constraintTo` | the target anchor on the target widget |

### connect

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

```
public void connect(ConstraintAnchor from, ConstraintAnchor to, int margin)
```

Connect the given anchors together (the from anchor should be owned by this widget)

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor from` | the anchor we are connecting from (of this widget) |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor to` | the anchor we are connecting to |
| `int margin` | how much margin we want to have |

### connect

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

```
public void connect(
    ConstraintAnchor.Type constraintFrom,
    ConstraintWidget target,
    ConstraintAnchor.Type constraintTo,
    int margin
)
```

Connect a given anchor of this widget to another anchor of a target widget

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type constraintFrom` | which anchor of this widget to connect from |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget target` | the target widget |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type constraintTo` | the target anchor on the target widget |
| `int margin` | how much margin we want to keep as a minimum distance between the two anchors |

### connectCircularConstraint

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

```
public void connectCircularConstraint(
    ConstraintWidget target,
    float angle,
    int radius
)
```

Set a circular constraint

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget target` | the target widget we will use as the center of the circle |
| `float angle` | the angle (from 0 to 360) |
| `int radius` | the radius used |

### copy

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

```
public void copy(
    ConstraintWidget src,
    HashMap<ConstraintWidget, ConstraintWidget> map
)
```

### createObjectVariables

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

```
public void createObjectVariables(LinearSystem system)
```

Create all the system variables for this widget

### ensureMeasureRequested

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

```
public void ensureMeasureRequested()
```

### ensureWidgetRuns

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

```
public void ensureWidgetRuns()
```

### getAnchor

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

```
public ConstraintAnchor getAnchor(ConstraintAnchor.Type anchorType)
```

Given a type of anchor, returns the corresponding anchor.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type anchorType` | type of the anchor (LEFT, TOP, RIGHT, BOTTOM, BASELINE, CENTER_X, CENTER_Y) |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor` | the matching anchor |

### getAnchors

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

```
public ArrayList<ConstraintAnchor> getAnchors()
```

Return the array of anchors of this widget

| Returns |
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor>` | array of anchors |

### getBaselineDistance

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

```
public int getBaselineDistance()
```

Return the baseline distance relative to the top of the widget

| Returns |
|---|---|
| `int` | baseline |

### getBiasPercent

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

```
public float getBiasPercent(int orientation)
```

Return the percentage bias that is used when two opposite connections exist of the same strength in a particular orientation.

| Parameters |
|---|---|
| `int orientation` | Orientation `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#HORIZONTAL()`/`https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#VERTICAL()`. |

| Returns |
|---|---|
| `float` | Respective percentage bias. |

### getBottom

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

```
public int getBottom()
```

Return the bottom position of the widget

| Returns |
|---|---|
| `int` | bottom position of the widget |

### getCompanionWidget

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

```
public Object getCompanionWidget()
```

Return the companion widget. Typically, this would be the real widget we represent with this instance of ConstraintWidget.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html` | the companion widget, if set. |

### getContainerItemSkip

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

```
public int getContainerItemSkip()
```

Accessor for the skip value

| Returns |
|---|---|
| `int` | skip value |

### getDebugName

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

```
public String getDebugName()
```

Returns the name of this widget (used for debug purposes)

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | the debug name |

### getDimensionBehaviour

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

```
public ConstraintWidget.DimensionBehaviour getDimensionBehaviour(int orientation)
```

Get the widget's `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` in an specific orientation.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` | The `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` of the widget. |

### getDimensionRatio

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

```
public float getDimensionRatio()
```

Return the current ratio of this widget

| Returns |
|---|---|
| `float` | the dimension ratio (HORIZONTAL, VERTICAL, or UNKNOWN) |

### getDimensionRatioSide

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

```
public int getDimensionRatioSide()
```

Return the current side on which ratio will be applied

| Returns |
|---|---|
| `int` | HORIZONTAL, VERTICAL, or UNKNOWN |

### getHasBaseline

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

```
public boolean getHasBaseline()
```

### getHeight

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

```
public int getHeight()
```

Return the height of the widget

| Returns |
|---|---|
| `int` | height height |

### getHorizontalBiasPercent

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

```
public float getHorizontalBiasPercent()
```

Return the horizontal percentage bias that is used when two opposite connections exist of the same strength.

| Returns |
|---|---|
| `float` | horizontal percentage bias |

### getHorizontalChainControlWidget

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

```
public ConstraintWidget getHorizontalChainControlWidget()
```

if in a horizontal chain return the left most widget in the chain.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | left most widget in chain or null |

### getHorizontalChainStyle

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

```
public int getHorizontalChainStyle()
```

get the chain starting from this widget to be packed. The horizontal bias will control how elements of the chain are positioned.

| Returns |
|---|---|
| `int` | Horizontal Chain Style |

### getHorizontalDimensionBehaviour

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

```
public ConstraintWidget.DimensionBehaviour getHorizontalDimensionBehaviour()
```

Accessor for the horizontal dimension behaviour

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` | dimension behaviour |

### getHorizontalMargin

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

```
public int getHorizontalMargin()
```

Returns all the horizontal margin of the widget.

### getLastHorizontalMeasureSpec

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

```
public int getLastHorizontalMeasureSpec()
```

### getLastVerticalMeasureSpec

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

```
public int getLastVerticalMeasureSpec()
```

### getLeft

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

```
public int getLeft()
```

Return the left position of the widget (similar to `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getX()`)

| Returns |
|---|---|
| `int` | left position of the widget |

### getLength

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

```
public int getLength(int orientation)
```

Get a dimension of the widget in a particular orientation.

| Returns |
|---|---|
| `int` | The dimension of the specified orientation. |

### getMaxHeight

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

```
public int getMaxHeight()
```

### getMaxWidth

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

```
public int getMaxWidth()
```

### getMinHeight

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

```
public int getMinHeight()
```

Return the minimum height of the widget

| Returns |
|---|---|
| `int` | minimum height |

### getMinWidth

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

```
public int getMinWidth()
```

Return the minimum width of the widget

| Returns |
|---|---|
| `int` | minimum width |

### getNextChainMember

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

```
public ConstraintWidget getNextChainMember(int orientation)
```

Return the next chain member if one exists

| Parameters |
|---|---|
| `int orientation` | HORIZONTAL or VERTICAL |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | the next chain member or null if we are the last chain element |

### getOptimizerWrapHeight

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

```
public int getOptimizerWrapHeight()
```

### getOptimizerWrapWidth

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

```
public int getOptimizerWrapWidth()
```

### getParent

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

```
public ConstraintWidget getParent()
```

Returns the parent of this widget if there is one

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | parent |

### getPreviousChainMember

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

```
public ConstraintWidget getPreviousChainMember(int orientation)
```

Return the previous chain member if one exists

| Parameters |
|---|---|
| `int orientation` | HORIZONTAL or VERTICAL |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | the previous chain member or null if we are the first chain element |

### getRight

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

```
public int getRight()
```

Return the right position of the widget

| Returns |
|---|---|
| `int` | right position of the widget |

### getRun

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

```
public WidgetRun getRun(int orientation)
```

### getSceneString

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

```
public void getSceneString(StringBuilder ret)
```

### getTop

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

```
public int getTop()
```

Return the top position of the widget (similar to `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget#getY()`)

| Returns |
|---|---|
| `int` | top position of the widget |

### getType

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

```
public String getType()
```

Returns the type string if set

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | type (null if not set) |

### getVerticalBiasPercent

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

```
public float getVerticalBiasPercent()
```

Return the vertical percentage bias that is used when two opposite connections exist of the same strength.

| Returns |
|---|---|
| `float` | vertical percentage bias |

### getVerticalChainControlWidget

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

```
public ConstraintWidget getVerticalChainControlWidget()
```

if in a vertical chain return the top most widget in the chain.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | top most widget in chain or null |

### getVerticalChainStyle

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

```
public int getVerticalChainStyle()
```

Set the chain starting from this widget to be packed. The vertical bias will control how elements of the chain are positioned.

### getVerticalDimensionBehaviour

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

```
public ConstraintWidget.DimensionBehaviour getVerticalDimensionBehaviour()
```

Accessor for the vertical dimension behaviour

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour` | dimension behaviour |

### getVerticalMargin

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

```
public int getVerticalMargin()
```

Returns all the vertical margin of the widget

### getVisibility

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

```
public int getVisibility()
```

Returns the current visibility value for this widget

| Returns |
|---|---|
| `int` | the visibility (VISIBLE, INVISIBLE, or GONE) |

### getWidth

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

```
public int getWidth()
```

Return the width of the widget

| Returns |
|---|---|
| `int` | width width |

### getWrapBehaviorInParent

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

```
public int getWrapBehaviorInParent()
```

### getX

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

```
public int getX()
```

Return the x position of the widget, relative to its container

| Returns |
|---|---|
| `int` | x position |

### getY

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

```
public int getY()
```

Return the y position of the widget, relative to its container

| Returns |
|---|---|
| `int` | y position |

### hasBaseline

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

```
public boolean hasBaseline()
```

Return true if this widget has a baseline

| Returns |
|---|---|
| `boolean` | true if the widget has a baseline, false otherwise |

### hasDanglingDimension

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

```
public boolean hasDanglingDimension(int orientation)
```

### hasDependencies

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

```
public boolean hasDependencies()
```

### hasDimensionOverride

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

```
public boolean hasDimensionOverride()
```

### hasResolvedTargets

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

```
public boolean hasResolvedTargets(int orientation, int size)
```

### immediateConnect

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

```
public void immediateConnect(
    ConstraintAnchor.Type startType,
    ConstraintWidget target,
    ConstraintAnchor.Type endType,
    int margin,
    int goneMargin
)
```

Immediate connection to an anchor without any checks.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type startType` | The type of anchor on this widget |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget target` | The target widget |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type endType` | The type of anchor on the target widget |
| `int margin` | How much margin we want to keep as a minimum distance between the two anchors |
| `int goneMargin` | How much margin we want to keep if the target is set to `View.GONE` |

### isAnimated

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

```
public boolean isAnimated()
```

Returns if this widget is animated. Currently only affects gone behaviour

| Returns |
|---|---|
| `boolean` | true if ConstraintWidget is used in Animation |

### isHeightWrapContent

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

```
public boolean isHeightWrapContent()
```

Returns true if height is set to wrap_content

### isHorizontalSolvingPassDone

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

```
public boolean isHorizontalSolvingPassDone()
```

### isInBarrier

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

```
public boolean isInBarrier(int orientation)
```

### isInHorizontalChain

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

```
public boolean isInHorizontalChain()
```

Test if you are in a Horizontal chain

| Returns |
|---|---|
| `boolean` | true if in a horizontal chain |

### isInPlaceholder

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

```
public boolean isInPlaceholder()
```

### isInVerticalChain

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

```
public boolean isInVerticalChain()
```

Test if you are in a vertical chain

| Returns |
|---|---|
| `boolean` | true if in a vertical chain |

### isInVirtualLayout

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

```
public boolean isInVirtualLayout()
```

### isMeasureRequested

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

```
public boolean isMeasureRequested()
```

### isResolvedHorizontally

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

```
public boolean isResolvedHorizontally()
```

### isResolvedVertically

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

```
public boolean isResolvedVertically()
```

### isRoot

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

```
public boolean isRoot()
```

Returns true if the widget is the root widget

| Returns |
|---|---|
| `boolean` | true if root widget, false otherwise |

### isSpreadHeight

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

```
public boolean isSpreadHeight()
```

### isSpreadWidth

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

```
public boolean isSpreadWidth()
```

### isVerticalSolvingPassDone

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

```
public boolean isVerticalSolvingPassDone()
```

### isWidthWrapContent

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

```
public boolean isWidthWrapContent()
```

Returns true if width is set to wrap_content

### markHorizontalSolvingPassDone

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

```
public void markHorizontalSolvingPassDone()
```

### markVerticalSolvingPassDone

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

```
public void markVerticalSolvingPassDone()
```

### oppositeDimensionDependsOn

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

```
public boolean oppositeDimensionDependsOn(int orientation)
```

### oppositeDimensionsTied

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

```
public boolean oppositeDimensionsTied()
```

### reset

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

```
public void reset()
```

### resetAllConstraints

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

```
public void resetAllConstraints()
```

Reset all the constraints set on this widget

### resetAnchor

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

```
public void resetAnchor(ConstraintAnchor anchor)
```

Reset the given anchor

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor anchor` | the anchor we want to reset |

### resetAnchors

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

```
public void resetAnchors()
```

Reset all connections

### resetFinalResolution

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

```
public void resetFinalResolution()
```

### resetSolverVariables

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

```
public void resetSolverVariables(Cache cache)
```

Reset the solver variables of the anchors

### resetSolvingPassFlag

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

```
public void resetSolvingPassFlag()
```

### serialize

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

```
public StringBuilder serialize(StringBuilder ret)
```

Serialize the anchors for JSON5 output

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/StringBuilder.html ret` | StringBuilder to be populated |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/StringBuilder.html` | the same string builder to alow chaining |

### setAnimated

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

```
public void setAnimated(boolean animated)
```

Set if this widget is animated. Currently only affects gone behaviour

| Parameters |
|---|---|
| `boolean animated` | if true the widget must be positioned correctly when not visible |

### setBaselineDistance

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

```
public void setBaselineDistance(int baseline)
```

Set the baseline distance relative to the top of the widget

| Parameters |
|---|---|
| `int baseline` | the distance of the baseline relative to the widget's top |

### setCompanionWidget

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

```
public void setCompanionWidget(Object companion)
```

Set the companion widget. Typically, this would be the real widget we represent with this instance of ConstraintWidget.

### setContainerItemSkip

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

```
public void setContainerItemSkip(int skip)
```

Set the skip value for this widget. This can be used when a widget is in a container, so that container can position the widget as if it was positioned further in the list of widgets. For example, with Table, this is used to skip empty cells (the widget after an empty cell will have a skip value of one)

### setDebugName

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

```
public void setDebugName(String name)
```

Set the debug name of this widget

### setDebugSolverName

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

```
public void setDebugSolverName(LinearSystem system, String name)
```

Utility debug function. Sets the names of the anchors in the solver given a widget's name. The given name is used as a prefix, resulting in anchors' names of the form:

- {name}.left
- {name}.top
- {name}.right
- {name}.bottom
- {name}.baseline

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system` | solver used |
| `https://developer.android.com/reference/java/lang/String.html name` | name of the widget |

### setDimension

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

```
public void setDimension(int w, int h)
```

Set both width and height of the widget

| Parameters |
|---|---|
| `int w` | width |
| `int h` | height |

### setDimensionRatio

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

```
public void setDimensionRatio(String ratio)
```

Set the ratio of the widget

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html ratio` | given string of format \[H\|V\],\[float\|x:y\] or \[float\|x:y\] |

### setDimensionRatio

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

```
public void setDimensionRatio(float ratio, int dimensionRatioSide)
```

Set the ratio of the widget The ratio will be applied if at least one of the dimension (width or height) is set to a behaviour of DimensionBehaviour.MATCH_CONSTRAINT -- the dimension's value will be set to the other dimension \* ratio.

| Parameters |
|---|---|
| `float ratio` | A float value that describes W/H or H/W depending on the provided dimensionRatioSide |
| `int dimensionRatioSide` | The side the ratio should be calculated on, HORIZONTAL, VERTICAL, or UNKNOWN |

### setFinalBaseline

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

```
public void setFinalBaseline(int baselineValue)
```

### setFinalFrame

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

```
public void setFinalFrame(
    int left,
    int top,
    int right,
    int bottom,
    int baseline,
    int orientation
)
```

### setFinalHorizontal

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

```
public void setFinalHorizontal(int x1, int x2)
```

### setFinalLeft

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

```
public void setFinalLeft(int x1)
```

### setFinalTop

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

```
public void setFinalTop(int y1)
```

### setFinalVertical

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

```
public void setFinalVertical(int y1, int y2)
```

### setFrame

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

```
public void setFrame(int start, int end, int orientation)
```

Set the position+dimension of the widget based on starting/ending positions on one dimension.

| Parameters |
|---|---|
| `int start` | Left/Top side position of the widget. |
| `int end` | Right/Bottom side position of the widget. |
| `int orientation` | Orientation being set (HORIZONTAL/VERTICAL). |

### setFrame

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

```
public void setFrame(int left, int top, int right, int bottom)
```

Set the position+dimension of the widget given left/top/right/bottom

| Parameters |
|---|---|
| `int left` | left side position of the widget |
| `int top` | top side position of the widget |
| `int right` | right side position of the widget |
| `int bottom` | bottom side position of the widget |

### setGoneMargin

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

```
public void setGoneMargin(ConstraintAnchor.Type type, int goneMargin)
```

Set the margin to be used when connected to a widget with a visibility of GONE

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintAnchor.Type type` | the anchor to set the margin on |
| `int goneMargin` | the margin value to use |

### setHasBaseline

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

```
public void setHasBaseline(boolean hasBaseline)
```

### setHeight

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

```
public void setHeight(int h)
```

Set the height of the widget

| Parameters |
|---|---|
| `int h` | height |

### setHeightWrapContent

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

```
public void setHeightWrapContent(boolean heightWrapContent)
```

Keep track of wrap_content for height

### setHorizontalBiasPercent

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

```
public void setHorizontalBiasPercent(float horizontalBiasPercent)
```

Set the horizontal bias percent to apply when we have two opposite constraints of equal strength

| Parameters |
|---|---|
| `float horizontalBiasPercent` | the percentage used |

### setHorizontalChainStyle

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

```
public void setHorizontalChainStyle(int horizontalChainStyle)
```

Set the chain starting from this widget to be packed. The horizontal bias will control how elements of the chain are positioned.

| Parameters |
|---|---|
| `int horizontalChainStyle` | (CHAIN_SPREAD, CHAIN_SPREAD_INSIDE, CHAIN_PACKED) |

### setHorizontalDimension

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

```
public void setHorizontalDimension(int left, int right)
```

Set the positions for the horizontal dimension only

| Parameters |
|---|---|
| `int left` | left side position of the widget |
| `int right` | right side position of the widget |

### setHorizontalDimensionBehaviour

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

```
public void setHorizontalDimensionBehaviour(
    ConstraintWidget.DimensionBehaviour behaviour
)
```

Set the widget's behaviour for the horizontal dimension

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour behaviour` | the horizontal dimension's behaviour |

### setHorizontalMatchStyle

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

```
public void setHorizontalMatchStyle(
    int horizontalMatchStyle,
    int min,
    int max,
    float percent
)
```

Set the horizontal style when MATCH_CONSTRAINT is set

| Parameters |
|---|---|
| `int horizontalMatchStyle` | MATCH_CONSTRAINT_SPREAD or MATCH_CONSTRAINT_WRAP |
| `int min` | minimum value |
| `int max` | maximum value |
| `float percent` | Percent width |

### setHorizontalWeight

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

```
public void setHorizontalWeight(float horizontalWeight)
```

Set the horizontal weight (only used in chains)

| Parameters |
|---|---|
| `float horizontalWeight` | Floating point value weight |

### setInPlaceholder

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

```
public void setInPlaceholder(boolean inPlaceholder)
```

### setInVirtualLayout

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

```
public void setInVirtualLayout(boolean inVirtualLayout)
```

### setLastMeasureSpec

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

```
public void setLastMeasureSpec(int horizontal, int vertical)
```

### setLength

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

```
public void setLength(int length, int orientation)
```

Set the dimension of a widget in a particular orientation.

| Parameters |
|---|---|
| `int length` | Size of the dimension. |
| `int orientation` | HORIZONTAL or VERTICAL |

### setMaxHeight

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

```
public void setMaxHeight(int maxHeight)
```

### setMaxWidth

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

```
public void setMaxWidth(int maxWidth)
```

### setMeasureRequested

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

```
public void setMeasureRequested(boolean measureRequested)
```

### setMinHeight

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

```
public void setMinHeight(int h)
```

Set the minimum height of the widget

| Parameters |
|---|---|
| `int h` | minimum height |

### setMinWidth

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

```
public void setMinWidth(int w)
```

Set the minimum width of the widget

| Parameters |
|---|---|
| `int w` | minimum width |

### setOffset

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

```
public void setOffset(int x, int y)
```

Set the offset of this widget relative to the root widget

| Parameters |
|---|---|
| `int x` | horizontal offset |
| `int y` | vertical offset |

### setOrigin

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

```
public void setOrigin(int x, int y)
```

Set both the origin in (x, y) of the widget, relative to its container

| Parameters |
|---|---|
| `int x` | x position |
| `int y` | y position |

### setParent

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

```
public void setParent(ConstraintWidget widget)
```

Set the parent of this widget

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget widget` | parent |

### setType

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

```
public void setType(String type)
```

Set the type of the widget (as a String)

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html type` | type of the widget |

### setVerticalBiasPercent

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

```
public void setVerticalBiasPercent(float verticalBiasPercent)
```

Set the vertical bias percent to apply when we have two opposite constraints of equal strength

| Parameters |
|---|---|
| `float verticalBiasPercent` | the percentage used |

### setVerticalChainStyle

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

```
public void setVerticalChainStyle(int verticalChainStyle)
```

Set the chain starting from this widget to be packed. The vertical bias will control how elements of the chain are positioned.

| Parameters |
|---|---|
| `int verticalChainStyle` | (CHAIN_SPREAD, CHAIN_SPREAD_INSIDE, CHAIN_PACKED) |

### setVerticalDimension

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

```
public void setVerticalDimension(int top, int bottom)
```

Set the positions for the vertical dimension only

| Parameters |
|---|---|
| `int top` | top side position of the widget |
| `int bottom` | bottom side position of the widget |

### setVerticalDimensionBehaviour

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

```
public void setVerticalDimensionBehaviour(
    ConstraintWidget.DimensionBehaviour behaviour
)
```

Set the widget's behaviour for the vertical dimension

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour behaviour` | the vertical dimension's behaviour |

### setVerticalMatchStyle

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

```
public void setVerticalMatchStyle(
    int verticalMatchStyle,
    int min,
    int max,
    float percent
)
```

Set the vertical style when MATCH_CONSTRAINT is set

| Parameters |
|---|---|
| `int verticalMatchStyle` | MATCH_CONSTRAINT_SPREAD or MATCH_CONSTRAINT_WRAP |
| `int min` | minimum value |
| `int max` | maximum value |
| `float percent` | Percent height |

### setVerticalWeight

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

```
public void setVerticalWeight(float verticalWeight)
```

Set the vertical weight (only used in chains)

| Parameters |
|---|---|
| `float verticalWeight` | Floating point value weight |

### setVisibility

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

```
public void setVisibility(int visibility)
```

Set the visibility for this widget

| Parameters |
|---|---|
| `int visibility` | either VISIBLE, INVISIBLE, or GONE |

### setWidth

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

```
public void setWidth(int w)
```

Set the width of the widget

| Parameters |
|---|---|
| `int w` | width |

### setWidthWrapContent

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

```
public void setWidthWrapContent(boolean widthWrapContent)
```

Keep track of wrap_content for width

### setWrapBehaviorInParent

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

```
public void setWrapBehaviorInParent(int behavior)
```

### setX

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

```
public void setX(int x)
```

Set the x position of the widget, relative to its container

| Parameters |
|---|---|
| `int x` | x position |

### setY

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

```
public void setY(int y)
```

Set the y position of the widget, relative to its container

| Parameters |
|---|---|
| `int y` | y position |

### setupDimensionRatio

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

```
public void setupDimensionRatio(
    boolean hParentWrapContent,
    boolean vParentWrapContent,
    boolean horizontalDimensionFixed,
    boolean verticalDimensionFixed
)
```

Resolves the dimension ratio parameters (mResolvedDimensionRatioSide \&mDimensionRatio)

| Parameters |
|---|---|
| `boolean hParentWrapContent` | true if parent is in wrap content horizontally |
| `boolean vParentWrapContent` | true if parent is in wrap content vertically |
| `boolean horizontalDimensionFixed` | true if this widget horizontal dimension is fixed |
| `boolean verticalDimensionFixed` | true if this widget vertical dimension is fixed |

### toString

```
public String toString()
```

Returns a string representation of the ConstraintWidget

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | string representation of the widget |

### updateFromRuns

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

```
public void updateFromRuns(boolean updateHorizontal, boolean updateVertical)
```

### updateFromSolver

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

```
public void updateFromSolver(LinearSystem system, boolean optimize)
```

Update the widget from the values generated by the solver

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system` | the solver we get the values from. |
| `boolean optimize` | true if `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/Optimizer#OPTIMIZATION_GRAPH()` is on |

## Protected methods

### getRootX

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

```
protected int getRootX()
```

Return the x position of the widget, relative to the root (without animation)

| Returns |
|---|---|
| `int` | x position |

### getRootY

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

```
protected int getRootY()
```

Return the y position of the widget, relative to the root (without animation)

### setInBarrier

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

```
protected void setInBarrier(int orientation, boolean value)
```