# ConstraintLayout.LayoutParams

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

*** ** * ** ***


```
public class ConstraintLayout.LayoutParams extends ViewGroup.MarginLayoutParams
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |||
|   | ↳ | [android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html) ||
|   |   | ↳ | [androidx.constraintlayout.widget.ConstraintLayout.LayoutParams](https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams) |

Known direct subclasses [Constraints.LayoutParams](https://developer.android.com/reference/androidx/constraintlayout/widget/Constraints.LayoutParams)

|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/Constraints.LayoutParams` |   |

*** ** * ** ***

This class contains the different attributes specifying how a view want to be laid out inside a `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout`. For building up constraints at run time, using `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet` is recommended.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#BASELINE() = 5` The baseline of the text in a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#BOTTOM() = 4` The bottom side of a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_PACKED() = 2` Chain packed style |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_SPREAD() = 0` Chain spread style |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_SPREAD_INSIDE() = 1` Chain spread inside style |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CIRCLE() = 8` Circle reference from a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#END() = 7` The right side of a view in left to right languages. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#GONE_UNSET() = -2147483648` Defines an id that is not set. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#HORIZONTAL() = 0` The horizontal orientation. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#LEFT() = 1` The left side of a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT() = 0` Dimension will be controlled by constraints. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_PERCENT() = 2` Set matchConstraintDefault\* percent to be based on a percent of another dimension (by default, the parent) Use to set the matchConstraintDefaultWidth and matchConstraintDefaultHeight |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_SPREAD() = 0` Set matchConstraintDefault\* spread as much as possible within its constraints. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_WRAP() = 1` Set matchConstraintDefault\* default to the wrap content size. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#PARENT_ID() = 0` References the id of the parent. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#RIGHT() = 2` The right side of a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#START() = 6` The left side of a view in left to right languages. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#TOP() = 3` The top of a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#UNSET() = -1` Defines an id that is not set. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#VERTICAL() = 1` The vertical orientation. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#WRAP_BEHAVIOR_HORIZONTAL_ONLY() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#WRAP_BEHAVIOR_INCLUDED() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#WRAP_BEHAVIOR_SKIPPED() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#WRAP_BEHAVIOR_VERTICAL_ONLY() = 2` |

| ### Public fields |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#baselineMargin()` The baseline margin. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#baselineToBaseline()` Constrains the baseline of a child to the baseline of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#baselineToBottom()` Constrains the baseline of a child to the bottom of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#baselineToTop()` Constrains the baseline of a child to the top of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#bottomToBottom()` Constrains the bottom side of a child to the bottom side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#bottomToTop()` Constrains the bottom side of a child to the top side of a target child (contains the target child id). |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#circleAngle()` The angle used for a circular constraint\] |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#circleConstraint()` Constrains the center of a child to the center of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#circleRadius()` The radius used for a circular constraint |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#constrainedHeight()` Specify if the vertical dimension is constrained in case both top \&bottom constraints are set and the widget dimension is not a fixed dimension. |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#constrainedWidth()` Specify if the horizontal dimension is constrained in case both left \&right constraints are set and the widget dimension is not a fixed dimension. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#constraintTag()` Define a category of view to be used by helpers and motionLayout |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#dimensionRatio()` The ratio information. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#editorAbsoluteX()` The design time location of the left side of the child. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#editorAbsoluteY()` The design time location of the right side of the child. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#endToEnd()` Constrains the end side of a child to the end side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#endToStart()` Constrains the end side of a child to the start side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#goneBaselineMargin()` The baseline margin to use when the target is gone. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#goneBottomMargin()` The bottom margin to use when the target is gone. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#goneEndMargin()` The end margin to use when the target is gone. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#goneLeftMargin()` The left margin to use when the target is gone. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#goneRightMargin()` The right margin to use when the target is gone |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#goneStartMargin()` The start margin to use when the target is gone. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#goneTopMargin()` The top margin to use when the target is gone. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#guideBegin()` The distance of child (guideline) to the top or left edge of its parent. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#guideEnd()` The distance of child (guideline) to the bottom or right edge of its parent. |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#guidePercent()` The ratio of the distance to the parent's sides |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#guidelineUseRtl()` The ratio of the distance to the parent's sides |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#helped()` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#horizontalBias()` The ratio between two connections when the left and right (or start and end) sides are constrained. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#horizontalChainStyle()` If the child is the start of a horizontal chain, this attribute will drive how the elements of the chain will be positioned. |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#horizontalWeight()` The child's weight that we can use to distribute the available horizontal space in a chain, if the dimension behaviour is set to MATCH_CONSTRAINT |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#leftToLeft()` Constrains the left side of a child to the left side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#leftToRight()` Constrains the left side of a child to the right side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#matchConstraintDefaultHeight()` Define how the widget vertical dimension is handled when set to MATCH_CONSTRAINT |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#matchConstraintDefaultWidth()` Define how the widget horizontal dimension is handled when set to MATCH_CONSTRAINT |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#matchConstraintMaxHeight()` Specify a maximum height size for the widget. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#matchConstraintMaxWidth()` Specify a maximum width size for the widget. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#matchConstraintMinHeight()` Specify a minimum height size for the widget. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#matchConstraintMinWidth()` Specify a minimum width size for the widget. |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#matchConstraintPercentHeight()` Specify the percentage when using the match constraint percent mode. |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#matchConstraintPercentWidth()` Specify the percentage when using the match constraint percent mode. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#orientation()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#rightToLeft()` Constrains the right side of a child to the left side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#rightToRight()` Constrains the right side of a child to the right side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#startToEnd()` Constrains the start side of a child to the end side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#startToStart()` Constrains the start side of a child to the start side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#topToBottom()` Constrains the top side of a child to the bottom side of a target child (contains the target child id). |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#topToTop()` Constrains the top side of a child to the top side of a target child (contains the target child id). |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#verticalBias()` The ratio between two connections when the top and bottom sides are constrained. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#verticalChainStyle()` If the child is the start of a vertical chain, this attribute will drive how the elements of the chain will be positioned. |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#verticalWeight()` The child's weight that we can use to distribute the available vertical space in a chain, if the dimension behaviour is set to MATCH_CONSTRAINT |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#wrapBehaviorInParent()` Specify how this view is taken in account during the parent's wrap computation Can be either of: WRAP_BEHAVIOR_INCLUDED the widget is taken in account for the wrap (default) WRAP_BEHAVIOR_HORIZONTAL_ONLY the widget will be included in the wrap only horizontally WRAP_BEHAVIOR_VERTICAL_ONLY the widget will be included in the wrap only vertically WRAP_BEHAVIOR_SKIPPED the widget is not part of the wrap computation |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#LayoutParams(android.view.ViewGroup.LayoutParams)(https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html params)` Create a LayoutParams base on an existing layout Params |
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#LayoutParams(android.content.Context,android.util.AttributeSet)(https://developer.android.com/reference/android/content/Context.html c, https://developer.android.com/reference/android/util/AttributeSet.html attrs)` //////////////////////////////////////////////////////////////////////////////////// |
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#LayoutParams(int,int)(int width, int height)` |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#getConstraintTag()()` Tag that can be used to identify a view as being a member of a group. |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#getConstraintWidget()()` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#reset()()` Reset the ConstraintWidget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#resolveLayoutDirection(int)(int layoutDirection)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#setWidgetDebugName(java.lang.String)(https://developer.android.com/reference/java/lang/String.html text)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#validate()()` validate the layout |

| ### Inherited Constants |
|---|
| From [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |---|---| | `static final int` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#FILL_PARENT = -1` **This field is deprecated.** | | `static final int` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT = -1` | | `static final int` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT = -2` | |

| ### Inherited fields |
|---|
| From [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |---|---| | `int` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#height` | | `https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters.html` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#layoutAnimationParameters` | | `int` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#width` | |
| From [android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html) |---|---| | `int` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#bottomMargin` | | `int` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#leftMargin` | | `int` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#rightMargin` | | `int` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#topMargin` | |

| ### Inherited methods |
|---|
| From [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |---|---| | `void` | `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#setBaseAttributes(android.content.res.TypedArray, int, int)(https://developer.android.com/reference/android/content/res/TypedArray.html a, int widthAttr, int heightAttr)` | |
| From [android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html) |---|---| | `int` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getLayoutDirection()()` | | `int` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getMarginEnd()()` | | `int` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getMarginStart()()` | | `boolean` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#isMarginRelative()()` | | `void` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setLayoutDirection(int)(int layoutDirection)` | | `void` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMarginEnd(int)(int end)` | | `void` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMarginStart(int)(int start)` | | `void` | `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMargins(int, int, int, int)(int left, int top, int right, int bottom)` | |

## Constants

### BASELINE

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

```
public static final int BASELINE = 5
```

The baseline of the text in a view.

### BOTTOM

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

```
public static final int BOTTOM = 4
```

The bottom side of a view.

### CHAIN_PACKED

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

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

Chain packed style

### CHAIN_SPREAD

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

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

Chain spread style

### CHAIN_SPREAD_INSIDE

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

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

Chain spread inside style

### CIRCLE

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

```
public static final int CIRCLE = 8
```

Circle reference from a view.

### END

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

```
public static final int END = 7
```

The right side of a view in left to right languages. In right to left languages it corresponds to the left side of the view

### GONE_UNSET

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

```
public static final int GONE_UNSET = -2147483648
```

Defines an id that is not set.

### HORIZONTAL

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

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

The horizontal orientation.

### LEFT

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

```
public static final int LEFT = 1
```

The left side of a view.

### MATCH_CONSTRAINT

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

```
public static final int MATCH_CONSTRAINT = 0
```

Dimension will be controlled by constraints.

### MATCH_CONSTRAINT_PERCENT

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

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

Set matchConstraintDefault\* percent to be based on a percent of another dimension (by default, the parent) Use to set the matchConstraintDefaultWidth and matchConstraintDefaultHeight

### MATCH_CONSTRAINT_SPREAD

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

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

Set matchConstraintDefault\* spread as much as possible within its constraints. Use to set the matchConstraintDefaultWidth and matchConstraintDefaultHeight

### MATCH_CONSTRAINT_WRAP

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

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

Set matchConstraintDefault\* default to the wrap content size. Use to set the matchConstraintDefaultWidth and matchConstraintDefaultHeight

### PARENT_ID

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

```
public static final int PARENT_ID = 0
```

References the id of the parent.

### RIGHT

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

```
public static final int RIGHT = 2
```

The right side of a view.

### START

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

```
public static final int START = 6
```

The left side of a view in left to right languages. In right to left languages it corresponds to the right side of the view

### TOP

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

```
public static final int TOP = 3
```

The top of a view.

### UNSET

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

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

Defines an id that is not set.

### VERTICAL

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

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

The vertical orientation.

### WRAP_BEHAVIOR_HORIZONTAL_ONLY

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

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

### WRAP_BEHAVIOR_INCLUDED

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

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

### WRAP_BEHAVIOR_SKIPPED

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

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

### WRAP_BEHAVIOR_VERTICAL_ONLY

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

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

## Public fields

### baselineMargin

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

```
public int baselineMargin
```

The baseline margin.

### baselineToBaseline

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

```
public int baselineToBaseline
```

Constrains the baseline of a child to the baseline of a target child (contains the target child id).

### baselineToBottom

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

```
public int baselineToBottom
```

Constrains the baseline of a child to the bottom of a target child (contains the target child id).

### baselineToTop

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

```
public int baselineToTop
```

Constrains the baseline of a child to the top of a target child (contains the target child id).

### bottomToBottom

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

```
public int bottomToBottom
```

Constrains the bottom side of a child to the bottom side of a target child (contains the target child id).

### bottomToTop

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

```
public int bottomToTop
```

Constrains the bottom side of a child to the top side of a target child (contains the target child id).

### circleAngle

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

```
public float circleAngle
```

The angle used for a circular constraint\]

### circleConstraint

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

```
public int circleConstraint
```

Constrains the center of a child to the center of a target child (contains the target child id).

### circleRadius

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

```
public int circleRadius
```

The radius used for a circular constraint

### constrainedHeight

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

```
public boolean constrainedHeight
```

Specify if the vertical dimension is constrained in case both top \&bottom constraints are set and the widget dimension is not a fixed dimension. By default, if a widget is set to WRAP_CONTENT, we will treat that dimension as a fixed dimension, meaning the dimension will not change regardless of constraints. Setting this attribute to true allows the dimension to change in order to respect constraints.

### constrainedWidth

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

```
public boolean constrainedWidth
```

Specify if the horizontal dimension is constrained in case both left \&right constraints are set and the widget dimension is not a fixed dimension. By default, if a widget is set to WRAP_CONTENT, we will treat that dimension as a fixed dimension, meaning the dimension will not change regardless of constraints. Setting this attribute to true allows the dimension to change in order to respect constraints.

### constraintTag

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

```
public String constraintTag
```

Define a category of view to be used by helpers and motionLayout

### dimensionRatio

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

```
public String dimensionRatio
```

The ratio information.

### editorAbsoluteX

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

```
public int editorAbsoluteX
```

The design time location of the left side of the child. Used at design time for a horizontally unconstrained child.

### editorAbsoluteY

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

```
public int editorAbsoluteY
```

The design time location of the right side of the child. Used at design time for a vertically unconstrained child.

### endToEnd

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

```
public int endToEnd
```

Constrains the end side of a child to the end side of a target child (contains the target child id).

### endToStart

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

```
public int endToStart
```

Constrains the end side of a child to the start side of a target child (contains the target child id).

### goneBaselineMargin

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

```
public int goneBaselineMargin
```

The baseline margin to use when the target is gone.

### goneBottomMargin

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

```
public int goneBottomMargin
```

The bottom margin to use when the target is gone.

### goneEndMargin

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

```
public int goneEndMargin
```

The end margin to use when the target is gone.

### goneLeftMargin

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

```
public int goneLeftMargin
```

The left margin to use when the target is gone.

### goneRightMargin

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

```
public int goneRightMargin
```

The right margin to use when the target is gone

### goneStartMargin

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

```
public int goneStartMargin
```

The start margin to use when the target is gone.

### goneTopMargin

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

```
public int goneTopMargin
```

The top margin to use when the target is gone.

### guideBegin

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

```
public int guideBegin
```

The distance of child (guideline) to the top or left edge of its parent.

### guideEnd

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

```
public int guideEnd
```

The distance of child (guideline) to the bottom or right edge of its parent.

### guidePercent

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

```
public float guidePercent
```

The ratio of the distance to the parent's sides

### guidelineUseRtl

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

```
public boolean guidelineUseRtl
```

The ratio of the distance to the parent's sides

### helped

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

```
public boolean helped
```

### horizontalBias

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

```
public float horizontalBias
```

The ratio between two connections when the left and right (or start and end) sides are constrained.

### horizontalChainStyle

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

```
public int horizontalChainStyle
```

If the child is the start of a horizontal chain, this attribute will drive how the elements of the chain will be positioned. The possible values are:

- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_SPREAD()` -- the elements will be spread out
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_SPREAD_INSIDE()` -- similar, but the endpoints of the chain will not be spread out
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_PACKED()` -- the elements of the chain will be packed together. The horizontal bias attribute of the child will then affect the positioning of the packed elements

### horizontalWeight

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

```
public float horizontalWeight
```

The child's weight that we can use to distribute the available horizontal space in a chain, if the dimension behaviour is set to MATCH_CONSTRAINT

### leftToLeft

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

```
public int leftToLeft
```

Constrains the left side of a child to the left side of a target child (contains the target child id).

### leftToRight

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

```
public int leftToRight
```

Constrains the left side of a child to the right side of a target child (contains the target child id).

### matchConstraintDefaultHeight

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

```
public int matchConstraintDefaultHeight
```

Define how the widget vertical dimension is handled when set to MATCH_CONSTRAINT

- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_SPREAD()` -- the default. The dimension will expand up to the constraints, minus margins
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_WRAP()` -- DEPRECATED -- use instead WRAP_CONTENT and constrainedWidth=true The dimension will be the same as WRAP_CONTENT, unless the size ends up too large for the constraints; in that case the dimension will expand up to the constraints, minus margins This attribute may not be applied if the widget is part of a chain in that dimension.
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_PERCENT()` -- The dimension will be a percent of another widget (by default, the parent)

### matchConstraintDefaultWidth

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

```
public int matchConstraintDefaultWidth
```

Define how the widget horizontal dimension is handled when set to MATCH_CONSTRAINT

- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_SPREAD()` -- the default. The dimension will expand up to the constraints, minus margins
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_WRAP()` -- DEPRECATED -- use instead WRAP_CONTENT and constrainedWidth=true The dimension will be the same as WRAP_CONTENT, unless the size ends up too large for the constraints; in that case the dimension will expand up to the constraints, minus margins This attribute may not be applied if the widget is part of a chain in that dimension.
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#MATCH_CONSTRAINT_PERCENT()` -- The dimension will be a percent of another widget (by default, the parent)

### matchConstraintMaxHeight

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

```
public int matchConstraintMaxHeight
```

Specify a maximum height size for the widget. It will only apply if the size of the widget is set to MATCH_CONSTRAINT. Don't apply if the widget is part of a vertical chain.

### matchConstraintMaxWidth

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

```
public int matchConstraintMaxWidth
```

Specify a maximum width size for the widget. It will only apply if the size of the widget is set to MATCH_CONSTRAINT. Don't apply if the widget is part of a horizontal chain.

### matchConstraintMinHeight

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

```
public int matchConstraintMinHeight
```

Specify a minimum height size for the widget. It will only apply if the size of the widget is set to MATCH_CONSTRAINT. Don't apply if the widget is part of a vertical chain.

### matchConstraintMinWidth

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

```
public int matchConstraintMinWidth
```

Specify a minimum width size for the widget. It will only apply if the size of the widget is set to MATCH_CONSTRAINT. Don't apply if the widget is part of a horizontal chain.

### matchConstraintPercentHeight

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

```
public float matchConstraintPercentHeight
```

Specify the percentage when using the match constraint percent mode. From 0 to 1.

### matchConstraintPercentWidth

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

```
public float matchConstraintPercentWidth
```

Specify the percentage when using the match constraint percent mode. From 0 to 1.

### orientation

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

```
public int orientation
```

### rightToLeft

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

```
public int rightToLeft
```

Constrains the right side of a child to the left side of a target child (contains the target child id).

### rightToRight

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

```
public int rightToRight
```

Constrains the right side of a child to the right side of a target child (contains the target child id).

### startToEnd

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

```
public int startToEnd
```

Constrains the start side of a child to the end side of a target child (contains the target child id).

### startToStart

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

```
public int startToStart
```

Constrains the start side of a child to the start side of a target child (contains the target child id).

### topToBottom

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

```
public int topToBottom
```

Constrains the top side of a child to the bottom side of a target child (contains the target child id).

### topToTop

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

```
public int topToTop
```

Constrains the top side of a child to the top side of a target child (contains the target child id).

### verticalBias

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

```
public float verticalBias
```

The ratio between two connections when the top and bottom sides are constrained.

### verticalChainStyle

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

```
public int verticalChainStyle
```

If the child is the start of a vertical chain, this attribute will drive how the elements of the chain will be positioned. The possible values are:

- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_SPREAD()` -- the elements will be spread out
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_SPREAD_INSIDE()` -- similar, but the endpoints of the chain will not be spread out
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams#CHAIN_PACKED()` -- the elements of the chain will be packed together. The vertical bias attribute of the child will then affect the positioning of the packed elements

### verticalWeight

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

```
public float verticalWeight
```

The child's weight that we can use to distribute the available vertical space in a chain, if the dimension behaviour is set to MATCH_CONSTRAINT

### wrapBehaviorInParent

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

```
public int wrapBehaviorInParent
```

Specify how this view is taken in account during the parent's wrap computation Can be either of: WRAP_BEHAVIOR_INCLUDED the widget is taken in account for the wrap (default) WRAP_BEHAVIOR_HORIZONTAL_ONLY the widget will be included in the wrap only horizontally WRAP_BEHAVIOR_VERTICAL_ONLY the widget will be included in the wrap only vertically WRAP_BEHAVIOR_SKIPPED the widget is not part of the wrap computation

## Public constructors

### LayoutParams

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

```
public LayoutParams(ViewGroup.LayoutParams params)
```

Create a LayoutParams base on an existing layout Params

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html params` | the Layout Params to be copied |

### LayoutParams

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

```
public LayoutParams(Context c, AttributeSet attrs)
```

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

### LayoutParams

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

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

## Public methods

### getConstraintTag

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

```
public String getConstraintTag()
```

Tag that can be used to identify a view as being a member of a group. Which can be used for Helpers or in MotionLayout

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | tag string or null if not defined |

### getConstraintWidget

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

```
public ConstraintWidget getConstraintWidget()
```

### reset

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

```
public void reset()
```

Reset the ConstraintWidget

### resolveLayoutDirection

```
public void resolveLayoutDirection(int layoutDirection)
```

### setWidgetDebugName

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

```
public void setWidgetDebugName(String text)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html text` |   |

### validate

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

```
public void validate()
```

validate the layout