# ConstraintSet

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

*** ** * ** ***


```
public class ConstraintSet
```

<br />

*** ** * ** ***

Defines a set of constraints to be used with `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout`.

`ConstraintSet` enables you create and save constraints and apply them to an existing `ConstraintLayout`. For details about constraint behaviour, see `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout`.

`ConstraintsSet` can be created in various ways:

- Manually --- `c = new ConstraintSet(); c.connect(...);`
- From an `R.layout.*` object --- `c.clone(context, R.layout.layout1);`
- From a `ConstraintLayout` --- `c.clone(constraintLayout);`

Example code:

```
import android.content.Context;
     import android.os.Bundle;
     import android.support.constraint.ConstraintLayout;
     import android.support.constraint.ConstraintSet;
     import android.support.transition.TransitionManager;
     import android.support.v7.app.AppCompatActivity;
     import android.view.View;

     public class MainActivity extends AppCompatActivity {
         ConstraintSet mConstraintSet1 = new ConstraintSet(); // Create a ConstraintSet.
         ConstraintSet mConstraintSet2 = new ConstraintSet(); // Create a ConstraintSet.
         ConstraintLayout mConstraintLayout; // Cache the ConstraintLayout.
         boolean mOld = true;


         protected void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
             Context context = this;
             mConstraintSet2.clone(context, R.layout.state2); // Get constraints from layout.
             setContentView(R.layout.state1);
             mConstraintLayout = (ConstraintLayout) findViewById(R.id.activity_main);
             mConstraintSet1.clone(mConstraintLayout); // Get constraints from ConstraintSet.
         }

         public void foo(View view) {
             TransitionManager.beginDelayedTransition(mConstraintLayout);
             if (mOld = !mOld) {
                 mConstraintSet1.applyTo(mConstraintLayout); // Set new constraints.
             }  else {
                 mConstraintSet2.applyTo(mConstraintLayout); // Set new constraints.
             }
         }
     }
```

## Summary

| ### Nested types |
|---|
| `public class https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint` |
| `public class https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Layout` |
| `public class https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Motion` |
| `public class https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.PropertySet` |
| `public class https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Transform` |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BASELINE() = 5` The baseline of the text in a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BOTTOM() = 4` The bottom side of a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#CHAIN_PACKED() = 2` Chain packed style |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#CHAIN_SPREAD() = 0` Chain spread style |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#CHAIN_SPREAD_INSIDE() = 1` Chain spread inside style |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#CIRCLE_REFERENCE() = 8` Circle reference from a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#END() = 7` The right side of a view in left to right languages. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#GONE() = 8` This view is gone, and will not take any space for layout purposes. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#HORIZONTAL() = 0` The horizontal orientation. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#HORIZONTAL_GUIDELINE() = 0` Used to create a horizontal create guidelines. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#INVISIBLE() = 4` This view is invisible, but it still takes up space for layout purposes. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#LEFT() = 1` The left side of a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#MATCH_CONSTRAINT() = 0` Dimension will be controlled by constraints |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#MATCH_CONSTRAINT_PERCENT() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#MATCH_CONSTRAINT_SPREAD() = 0` Calculate the size of a view in 0 dp by reducing the constrains gaps as much as possible |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#MATCH_CONSTRAINT_WRAP() = 1` How to calculate the size of a view in 0 dp by using its wrap_content size |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#PARENT_ID() = 0` References the id of the parent. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#RIGHT() = 2` The right side of a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#ROTATE_LEFT_OF_PORTRATE() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#ROTATE_NONE() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#ROTATE_PORTRATE_OF_LEFT() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#ROTATE_PORTRATE_OF_RIGHT() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#ROTATE_RIGHT_OF_PORTRATE() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#START() = 6` The left side of a view in left to right languages. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#TOP() = 3` The top of a view. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#UNSET() = -1` Used to indicate a parameter is cleared or not set |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VERTICAL() = 1` The vertical orientation. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VERTICAL_GUIDELINE() = 1` Used to create a vertical create guidelines. see `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#create(int,int)` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VISIBILITY_MODE_IGNORE() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VISIBILITY_MODE_NORMAL() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VISIBLE() = 0` This view is visible. |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#WRAP_CONTENT() = -2` Dimension will set by the view's content |

| ### Public fields |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#derivedState()` |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#mIdString()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#mRotate()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#ConstraintSet()()` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#addColorAttributes(java.lang.String...)(String[] attributeName)` Add attribute of type Color |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#addFloatAttributes(java.lang.String...)(String[] attributeName)` Add attribute of type float |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#addIntAttributes(java.lang.String...)(String[] attributeName)` Add attribute of type Int |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#addStringAttributes(java.lang.String...)(String[] attributeName)` Add attribute of type string |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#addToHorizontalChain(int,int,int)(int viewId, int leftId, int rightId)` Adds a view to a horizontal chain. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#addToHorizontalChainRTL(int,int,int)(int viewId, int leftId, int rightId)` Adds a view to a horizontal chain. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#addToVerticalChain(int,int,int)(int viewId, int topId, int bottomId)` Adds a view to a vertical chain. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#applyCustomAttributes(androidx.constraintlayout.widget.ConstraintLayout)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout)` Apply custom attributes alone |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#applyDeltaFrom(androidx.constraintlayout.widget.ConstraintSet)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet cs)` Get the delta form the ConstraintSet and aplly to this |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#applyTo(androidx.constraintlayout.widget.ConstraintLayout)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout)` Apply the constraints to a ConstraintLayout. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#applyToHelper(androidx.constraintlayout.widget.ConstraintHelper,androidx.constraintlayout.core.widgets.ConstraintWidget,androidx.constraintlayout.widget.ConstraintLayout.LayoutParams,android.util.SparseArray<androidx.constraintlayout.core.widgets.ConstraintWidget>)( https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintHelper helper, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget child, https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams layoutParams, https://developer.android.com/reference/android/util/SparseArray.html<https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget> mapIdToWidget )` Apply Layout to Helper widget |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#applyToLayoutParams(int,androidx.constraintlayout.widget.ConstraintLayout.LayoutParams)(int id, https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams layoutParams)` Fill in a ConstraintLayout LayoutParam based on the id. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#applyToWithoutCustom(androidx.constraintlayout.widget.ConstraintLayout)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout)` Apply the constraints to a ConstraintLayout. |
| `static https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#buildDelta(android.content.Context,org.xmlpull.v1.XmlPullParser)(https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser)` Used to read a ConstraintDelta |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#center(int,int,int,int,int,int,int,float)( int centerID, int firstID, int firstSide, int firstMargin, int secondId, int secondSide, int secondMargin, float bias )` Center widget between the other two widgets. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#centerHorizontally(int,int)(int viewId, int toView)` Centers the view horizontally relative to toView's position. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#centerHorizontally(int,int,int,int,int,int,int,float)( int centerID, int leftId, int leftSide, int leftMargin, int rightId, int rightSide, int rightMargin, float bias )` Centers the widget horizontally to the left and right side on another widgets sides. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#centerHorizontallyRtl(int,int)(int viewId, int toView)` Centers the view horizontally relative to toView's position. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#centerHorizontallyRtl(int,int,int,int,int,int,int,float)( int centerID, int startId, int startSide, int startMargin, int endId, int endSide, int endMargin, float bias )` Centers the widgets horizontally to the left and right side on another widgets sides. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#centerVertically(int,int)(int viewId, int toView)` Centers the view vertically relative to toView's position. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#centerVertically(int,int,int,int,int,int,int,float)( int centerID, int topId, int topSide, int topMargin, int bottomId, int bottomSide, int bottomMargin, float bias )` Centers the widgets vertically to the top and bottom side on another widgets sides. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#clear(int)(int viewId)` Remove all constraints from this view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#clear(int,int)(int viewId, int anchor)` Remove a constraint from this view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#clone(androidx.constraintlayout.widget.ConstraintLayout)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout)` Copy the layout parameters of a ConstraintLayout. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#clone(androidx.constraintlayout.widget.Constraints)(https://developer.android.com/reference/androidx/constraintlayout/widget/Constraints constraints)` Copy the layout parameters of a ConstraintLayout. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#clone(androidx.constraintlayout.widget.ConstraintSet)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet set)` Copy the constraints from a layout. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#clone(android.content.Context,int)(https://developer.android.com/reference/android/content/Context.html context, int constraintLayoutId)` Copy the constraints from a layout. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#connect(int,int,int,int)(int startID, int startSide, int endID, int endSide)` Create a constraint between two widgets. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#connect(int,int,int,int,int)(int startID, int startSide, int endID, int endSide, int margin)` Create a constraint between two widgets. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainCircle(int,int,int,float)(int viewId, int id, int radius, float angle)` Constrain the view on a circle constraint |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainDefaultHeight(int,int)(int viewId, int height)` Sets how the height is calculated ether MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainDefaultWidth(int,int)(int viewId, int width)` Sets how the width is calculated ether MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainHeight(int,int)(int viewId, int height)` Sets the height of the view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainMaxHeight(int,int)(int viewId, int height)` Sets the maximum height of the view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainMaxWidth(int,int)(int viewId, int width)` Sets the maximum width of the view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainMinHeight(int,int)(int viewId, int height)` Sets the height of the view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainMinWidth(int,int)(int viewId, int width)` Sets the width of the view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainPercentHeight(int,float)(int viewId, float percent)` Sets the height of the view as a percentage of the parent. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainPercentWidth(int,float)(int viewId, float percent)` Sets the width of the view as a percentage of the parent. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainWidth(int,int)(int viewId, int width)` Sets the width of the view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainedHeight(int,boolean)(int viewId, boolean constrained)` Sets how the height is calculated ether MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#constrainedWidth(int,boolean)(int viewId, boolean constrained)` Sets how the width is calculated ether MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#create(int,int)(int guidelineID, int orientation)` Creates a ConstraintLayout virtual object. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#createBarrier(int,int,int,int...)(int id, int direction, int margin, int[] referenced)` Creates a ConstraintLayout Barrier object. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#createHorizontalChain(int,int,int,int,int[],float[],int)( int leftId, int leftSide, int rightId, int rightSide, int[] chainIds, float[] weights, int style )` Spaces a set of widgets horizontally between the view startID and endId. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#createHorizontalChainRtl(int,int,int,int,int[],float[],int)( int startId, int startSide, int endId, int endSide, int[] chainIds, float[] weights, int style )` Spaces a set of widgets horizontal between the view startID and endId. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#createVerticalChain(int,int,int,int,int[],float[],int)( int topId, int topSide, int bottomId, int bottomSide, int[] chainIds, float[] weights, int style )` Spaces a set of widgets vertically between the view topId and bottomId. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#dump(androidx.constraintlayout.motion.widget.MotionScene,int...)(https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionScene scene, int[] ids)` Dump the contents |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getApplyElevation(int)(int viewId)` return with the constraint set will apply elevation for the specified view. |
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getConstraint(int)(int id)` |
| `https://developer.android.com/reference/java/util/HashMap.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintAttribute>` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getCustomAttributeSet()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getHeight(int)(int viewId)` Get the height set in the view |
| `int[]` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getKnownIds()()` |
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getParameters(int)(int mId)` |
| `int[]` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getReferencedIds(int)(int id)` get the reference id's of a helper. |
| `String[]` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getStateLabels()()` Get the types associated with this ConstraintSet The types mechanism allows you to tag the constraint set with a series of string to define properties of a ConstraintSet |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getVisibility(int)(int viewId)` Get the visibility flag set in this view |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getVisibilityMode(int)(int viewId)` ConstraintSet will not setVisibility. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#getWidth(int)(int viewId)` Get the width set in the view |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#isForceId()()` Enforce id are required for all ConstraintLayout children to use ConstraintSet. default = true; |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#isValidateOnParse()()` If true perform validation checks when parsing ConstraintSets This will slow down parsing and should only be used for debugging |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#load(android.content.Context,org.xmlpull.v1.XmlPullParser)(https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser)` Load a constraint set from a constraintSet.xml file |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#load(android.content.Context,int)(https://developer.android.com/reference/android/content/Context.html context, int resourceId)` Load a constraint set from a constraintSet.xml file. |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#matchesLabels(java.lang.String...)(String[] types)` Test if the list of strings matches labels defined on this constraintSet |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#parseColorAttributes(androidx.constraintlayout.widget.ConstraintSet.Constraint,java.lang.String)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint set, https://developer.android.com/reference/java/lang/String.html attributes)` Parse color |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#parseFloatAttributes(androidx.constraintlayout.widget.ConstraintSet.Constraint,java.lang.String)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint set, https://developer.android.com/reference/java/lang/String.html attributes)` Parse floats |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#parseIntAttributes(androidx.constraintlayout.widget.ConstraintSet.Constraint,java.lang.String)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint set, https://developer.android.com/reference/java/lang/String.html attributes)` Parse int |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#parseStringAttributes(androidx.constraintlayout.widget.ConstraintSet.Constraint,java.lang.String)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint set, https://developer.android.com/reference/java/lang/String.html attributes)` Parse string |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#readFallback(androidx.constraintlayout.widget.ConstraintLayout)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout)` This will copy Constraints from the ConstraintLayout if it does not have parameters |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#readFallback(androidx.constraintlayout.widget.ConstraintSet)(https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet set)` This will copy Constraints from the ConstraintSet |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#removeAttribute(java.lang.String)(https://developer.android.com/reference/java/lang/String.html attributeName)` Remove the attribute |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#removeFromHorizontalChain(int)(int viewId)` Removes a view from a horizontal chain. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#removeFromVerticalChain(int)(int viewId)` Removes a view from a vertical chain. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setAlpha(int,float)(int viewId, float alpha)` Adjust the alpha of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setApplyElevation(int,boolean)(int viewId, boolean apply)` set if elevation will be applied to the view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setBarrierType(int,int)(int id, int type)` SEt tye type of barier |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setColorValue(int,java.lang.String,int)(int viewId, https://developer.android.com/reference/java/lang/String.html attributeName, int value)` Set the value of an attribute of type color |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setDimensionRatio(int,java.lang.String)(int viewId, https://developer.android.com/reference/java/lang/String.html ratio)` Constrains the views aspect ratio. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setEditorAbsoluteX(int,int)(int viewId, int position)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setEditorAbsoluteY(int,int)(int viewId, int position)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setElevation(int,float)(int viewId, float elevation)` Adjust the elevation of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setFloatValue(int,java.lang.String,float)(int viewId, https://developer.android.com/reference/java/lang/String.html attributeName, float value)` Set the value of an attribute of type float |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setForceId(boolean)(boolean forceId)` Enforce id are required for all ConstraintLayout children to use ConstraintSet. default = true; |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setGoneMargin(int,int,int)(int viewId, int anchor, int value)` Sets the gone margin. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setGuidelineBegin(int,int)(int guidelineID, int margin)` Set the guideline's distance form the top or left edge. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setGuidelineEnd(int,int)(int guidelineID, int margin)` Set a guideline's distance to end. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setGuidelinePercent(int,float)(int guidelineID, float ratio)` Set a Guideline's percent. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setHorizontalBias(int,float)(int viewId, float bias)` Adjust the horizontal bias of the view (used with views constrained on left and right). |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setHorizontalChainStyle(int,int)(int viewId, int chainStyle)` How the elements of the horizontal chain will be positioned. if the dimension behaviour is set to MATCH_CONSTRAINT. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setHorizontalWeight(int,float)(int viewId, float weight)` 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 |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setIntValue(int,java.lang.String,int)(int viewId, https://developer.android.com/reference/java/lang/String.html attributeName, int value)` Set the value of an attribute of type int |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setLayoutWrapBehavior(int,int)(int viewId, int behavior)` Sets the wrap behavior of the widget in the parent's wrap computation |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setMargin(int,int,int)(int viewId, int anchor, int value)` Sets the margin. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setReferencedIds(int,int...)(int id, int[] referenced)` sets the reference id's of a barrier. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setRotation(int,float)(int viewId, float rotation)` Adjust the post-layout rotation about the Z axis of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setRotationX(int,float)(int viewId, float rotationX)` Adjust the post-layout rotation about the X axis of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setRotationY(int,float)(int viewId, float rotationY)` Adjust the post-layout rotation about the Y axis of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setScaleX(int,float)(int viewId, float scaleX)` Adjust the post-layout scale in X of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setScaleY(int,float)(int viewId, float scaleY)` Adjust the post-layout scale in Y of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setStateLabels(java.lang.String)(https://developer.android.com/reference/java/lang/String.html types)` Set the types associated with this ConstraintSet The types mechanism allows you to tag the constraint set with a series of string to define properties of a ConstraintSet |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setStateLabelsList(java.lang.String...)(String[] types)` Set the types associated with this ConstraintSet The types mechanism allows you to tag the constraint set with a series of string to define properties of a ConstraintSet |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setStringValue(int,java.lang.String,java.lang.String)(int viewId, https://developer.android.com/reference/java/lang/String.html attributeName, https://developer.android.com/reference/java/lang/String.html value)` Set the value of an attribute of type string |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setTransformPivot(int,float,float)( int viewId, float transformPivotX, float transformPivotY )` Set X,Y location of the pivot point around which the view will rotate and scale. use Float.NaN to clear the pivot value. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setTransformPivotX(int,float)(int viewId, float transformPivotX)` Set X location of the pivot point around which the view will rotate and scale. use Float.NaN to clear the pivot value. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setTransformPivotY(int,float)(int viewId, float transformPivotY)` Set Y location of the pivot point around which the view will rotate and scale. use Float.NaN to clear the pivot value. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setTranslation(int,float,float)(int viewId, float translationX, float translationY)` Adjust the post-layout translation of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setTranslationX(int,float)(int viewId, float translationX)` Adjust the post-layout X translation of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setTranslationY(int,float)(int viewId, float translationY)` Adjust the post-layout Y translation of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setTranslationZ(int,float)(int viewId, float translationZ)` Adjust the translation in Z of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setValidateOnParse(boolean)(boolean validate)` If true perform validation checks when parsing ConstraintSets This will slow down parsing and should only be used for debugging |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setVerticalBias(int,float)(int viewId, float bias)` Adjust the vertical bias of the view (used with views constrained on left and right). |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setVerticalChainStyle(int,int)(int viewId, int chainStyle)` How the elements of the vertical chain will be positioned. in a chain, if the dimension behaviour is set to MATCH_CONSTRAINT |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setVerticalWeight(int,float)(int viewId, float weight)` 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 |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setVisibility(int,int)(int viewId, int visibility)` Adjust the visibility of a view. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setVisibilityMode(int,int)(int viewId, int visibilityMode)` ConstraintSet will not setVisibility. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#writeState(java.io.Writer,androidx.constraintlayout.widget.ConstraintLayout,int)(https://developer.android.com/reference/java/io/Writer.html writer, https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout layout, int flags)` Write the state to a Writer |

## 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_REFERENCE

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

```
public static final int CIRCLE_REFERENCE = 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

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

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

This view is gone, and will not take any space for layout purposes. Use with `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setVisibility(int,int)` and [`
android:visibility`.](https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#attr_android:visibility)

### 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.

### HORIZONTAL_GUIDELINE

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

```
public static final int HORIZONTAL_GUIDELINE = 0
```

Used to create a horizontal create guidelines.

### INVISIBLE

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

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

This view is invisible, but it still takes up space for layout purposes. Use with `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setVisibility(int,int)` and [`
android:visibility`.](https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#attr_android:visibility)

### 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
```

### 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
```

Calculate the size of a view in 0 dp by reducing the constrains gaps as much as possible

### 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
```

How to calculate the size of a view in 0 dp by using its wrap_content size

### 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. Used in:

- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#connect(int,int,int,int,int)`
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#center(int,int,int,int,int,int,int,float)`

### 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.

### ROTATE_LEFT_OF_PORTRATE

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

```
public static final int ROTATE_LEFT_OF_PORTRATE = 4
```

### ROTATE_NONE

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

```
public static final int ROTATE_NONE = 0
```

### ROTATE_PORTRATE_OF_LEFT

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

```
public static final int ROTATE_PORTRATE_OF_LEFT = 2
```

### ROTATE_PORTRATE_OF_RIGHT

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

```
public static final int ROTATE_PORTRATE_OF_RIGHT = 1
```

### ROTATE_RIGHT_OF_PORTRATE

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

```
public static final int ROTATE_RIGHT_OF_PORTRATE = 3
```

### 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
```

Used to indicate a parameter is cleared or 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.

### VERTICAL_GUIDELINE

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

```
public static final int VERTICAL_GUIDELINE = 1
```

Used to create a vertical create guidelines. see `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#create(int,int)`

### VISIBILITY_MODE_IGNORE

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

```
public static final int VISIBILITY_MODE_IGNORE = 1
```

### VISIBILITY_MODE_NORMAL

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

```
public static final int VISIBILITY_MODE_NORMAL = 0
```

### VISIBLE

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

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

This view is visible. Use with `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#setVisibility(int,int)` and [`
android:visibility`.](https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#attr_android:visibility)

### WRAP_CONTENT

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

```
public static final int WRAP_CONTENT = -2
```

Dimension will set by the view's content

## Public fields

### derivedState

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

```
public String derivedState
```

### mIdString

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

```
public String mIdString
```

### mRotate

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

```
public int mRotate
```

## Public constructors

### ConstraintSet

Added in 2.2.2

```
public ConstraintSet()
```

## Public methods

### addColorAttributes

```
public void addColorAttributes(String[] attributeName)
```

Add attribute of type Color

| Parameters |
|---|---|
| `String[] attributeName` |   |

### addFloatAttributes

```
public void addFloatAttributes(String[] attributeName)
```

Add attribute of type float

| Parameters |
|---|---|
| `String[] attributeName` |   |

### addIntAttributes

```
public void addIntAttributes(String[] attributeName)
```

Add attribute of type Int

| Parameters |
|---|---|
| `String[] attributeName` |   |

### addStringAttributes

```
public void addStringAttributes(String[] attributeName)
```

Add attribute of type string

| Parameters |
|---|---|
| `String[] attributeName` |   |

### addToHorizontalChain

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

```
public void addToHorizontalChain(int viewId, int leftId, int rightId)
```

Adds a view to a horizontal chain.

| Parameters |
|---|---|
| `int viewId` | view to add |
| `int leftId` | view in chain to the left |
| `int rightId` | view in chain to the right |

### addToHorizontalChainRTL

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

```
public void addToHorizontalChainRTL(int viewId, int leftId, int rightId)
```

Adds a view to a horizontal chain.

| Parameters |
|---|---|
| `int viewId` | view to add |
| `int leftId` | view to the start side |
| `int rightId` | view to the end side |

### addToVerticalChain

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

```
public void addToVerticalChain(int viewId, int topId, int bottomId)
```

Adds a view to a vertical chain.

| Parameters |
|---|---|
| `int viewId` | view to add to a vertical chain |
| `int topId` | view above. |
| `int bottomId` | view below |

### applyCustomAttributes

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

```
public void applyCustomAttributes(ConstraintLayout constraintLayout)
```

Apply custom attributes alone

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout` |   |

### applyDeltaFrom

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

```
public void applyDeltaFrom(ConstraintSet cs)
```

Get the delta form the ConstraintSet and aplly to this

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet cs` |   |

### applyTo

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

```
public void applyTo(ConstraintLayout constraintLayout)
```

Apply the constraints to a ConstraintLayout.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout` | to be modified |

### applyToHelper

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

```
public void applyToHelper(
    ConstraintHelper helper,
    ConstraintWidget child,
    ConstraintLayout.LayoutParams layoutParams,
    SparseArray<ConstraintWidget> mapIdToWidget
)
```

Apply Layout to Helper widget

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintHelper helper` |   |
| `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget child` |   |
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams layoutParams` |   |
| `https://developer.android.com/reference/android/util/SparseArray.html<https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidget> mapIdToWidget` |   |

### applyToLayoutParams

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

```
public void applyToLayoutParams(int id, ConstraintLayout.LayoutParams layoutParams)
```

Fill in a ConstraintLayout LayoutParam based on the id.

| Parameters |
|---|---|
| `int id` | Id of the view |
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout.LayoutParams layoutParams` | LayoutParams to be filled |

### applyToWithoutCustom

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

```
public void applyToWithoutCustom(ConstraintLayout constraintLayout)
```

Apply the constraints to a ConstraintLayout.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout` | to be modified |

### buildDelta

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

```
public static ConstraintSet.Constraint buildDelta(Context context, XmlPullParser parser)
```

Used to read a ConstraintDelta

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` |   |
| `https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint` |   |

### center

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

```
public void center(
    int centerID,
    int firstID,
    int firstSide,
    int firstMargin,
    int secondId,
    int secondSide,
    int secondMargin,
    float bias
)
```

Center widget between the other two widgets. (for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#TOP()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BOTTOM()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#START()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#END()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#LEFT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#RIGHT()`) Note, sides must be all vertical or horizontal sides.

| Parameters |
|---|---|
| `int centerID` | ID of the widget to be centered |
| `int firstID` | ID of the first widget to connect the left or top of the widget to |
| `int firstSide` | the side of the widget to connect to |
| `int firstMargin` | the connection margin |
| `int secondId` | the ID of the second widget to connect to right or top of the widget to |
| `int secondSide` | the side of the widget to connect to |
| `int secondMargin` | the connection margin |
| `float bias` | the ratio between two connections |

### centerHorizontally

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

```
public void centerHorizontally(int viewId, int toView)
```

Centers the view horizontally relative to toView's position.

| Parameters |
|---|---|
| `int viewId` | ID of view to center Horizontally |
| `int toView` | ID of view to center on (or in) |

### centerHorizontally

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

```
public void centerHorizontally(
    int centerID,
    int leftId,
    int leftSide,
    int leftMargin,
    int rightId,
    int rightSide,
    int rightMargin,
    float bias
)
```

Centers the widget horizontally to the left and right side on another widgets sides. (for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#START()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#END()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#LEFT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#RIGHT()`)

| Parameters |
|---|---|
| `int centerID` | ID of widget to be centered |
| `int leftId` | The Id of the widget on the left side |
| `int leftSide` | The side of the leftId widget to connect to |
| `int leftMargin` | The margin on the left side |
| `int rightId` | The Id of the widget on the right side |
| `int rightSide` | The side of the rightId widget to connect to |
| `int rightMargin` | The margin on the right side |
| `float bias` | The ratio of the space on the left vs. right sides 0.5 is centered (default) |

### centerHorizontallyRtl

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

```
public void centerHorizontallyRtl(int viewId, int toView)
```

Centers the view horizontally relative to toView's position.

| Parameters |
|---|---|
| `int viewId` | ID of view to center Horizontally |
| `int toView` | ID of view to center on (or in) |

### centerHorizontallyRtl

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

```
public void centerHorizontallyRtl(
    int centerID,
    int startId,
    int startSide,
    int startMargin,
    int endId,
    int endSide,
    int endMargin,
    float bias
)
```

Centers the widgets horizontally to the left and right side on another widgets sides. (for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#START()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#END()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#LEFT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#RIGHT()`)

| Parameters |
|---|---|
| `int centerID` | ID of widget to be centered |
| `int startId` | The Id of the widget on the start side (left in non rtl languages) |
| `int startSide` | The side of the startId widget to connect to |
| `int startMargin` | The margin on the start side |
| `int endId` | The Id of the widget on the start side (left in non rtl languages) |
| `int endSide` | The side of the endId widget to connect to |
| `int endMargin` | The margin on the end side |
| `float bias` | The ratio of the space on the start vs end side 0.5 is centered (default) |

### centerVertically

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

```
public void centerVertically(int viewId, int toView)
```

Centers the view vertically relative to toView's position.

| Parameters |
|---|---|
| `int viewId` | ID of view to center Horizontally |
| `int toView` | ID of view to center on (or in) |

### centerVertically

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

```
public void centerVertically(
    int centerID,
    int topId,
    int topSide,
    int topMargin,
    int bottomId,
    int bottomSide,
    int bottomMargin,
    float bias
)
```

Centers the widgets vertically to the top and bottom side on another widgets sides. (for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#TOP()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BOTTOM()`)

| Parameters |
|---|---|
| `int centerID` | ID of widget to be centered |
| `int topId` | The Id of the widget on the top side |
| `int topSide` | The side of the leftId widget to connect to |
| `int topMargin` | The margin on the top side |
| `int bottomId` | The Id of the widget on the bottom side |
| `int bottomSide` | The side of the bottomId widget to connect to |
| `int bottomMargin` | The margin on the bottom side |
| `float bias` | The ratio of the space on the top vs. bottom sides 0.5 is centered (default) |

### clear

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

```
public void clear(int viewId)
```

Remove all constraints from this view.

| Parameters |
|---|---|
| `int viewId` | ID of view to remove all connections to |

### clear

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

```
public void clear(int viewId, int anchor)
```

Remove a constraint from this view.

| Parameters |
|---|---|
| `int viewId` | ID of view to center on (or in) |
| `int anchor` | the Anchor to remove constraint from |

### clone

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

```
public void clone(ConstraintLayout constraintLayout)
```

Copy the layout parameters of a ConstraintLayout.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout` | The ConstraintLayout to be copied |

### clone

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

```
public void clone(Constraints constraints)
```

Copy the layout parameters of a ConstraintLayout.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/Constraints constraints` | The ConstraintLayout to be copied |

### clone

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

```
public void clone(ConstraintSet set)
```

Copy the constraints from a layout.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet set` | constraint set to copy |

### clone

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

```
public void clone(Context context, int constraintLayoutId)
```

Copy the constraints from a layout.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | the context for the layout inflation |
| `int constraintLayoutId` | the id of the layout file |

### connect

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

```
public void connect(int startID, int startSide, int endID, int endSide)
```

Create a constraint between two widgets. (for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#TOP()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BOTTOM()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#START()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#END()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#LEFT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#RIGHT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BASELINE()`)

| Parameters |
|---|---|
| `int startID` | the ID of the widget to be constrained |
| `int startSide` | the side of the widget to constrain |
| `int endID` | the id of the widget to constrain to |
| `int endSide` | the side of widget to constrain to |

### connect

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

```
public void connect(int startID, int startSide, int endID, int endSide, int margin)
```

Create a constraint between two widgets. (for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#TOP()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BOTTOM()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#START()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#END()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#LEFT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#RIGHT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BASELINE()`)

| Parameters |
|---|---|
| `int startID` | the ID of the widget to be constrained |
| `int startSide` | the side of the widget to constrain |
| `int endID` | the id of the widget to constrain to |
| `int endSide` | the side of widget to constrain to |
| `int margin` | the margin to constrain (margin must be positive) |

### constrainCircle

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

```
public void constrainCircle(int viewId, int id, int radius, float angle)
```

Constrain the view on a circle constraint

| Parameters |
|---|---|
| `int viewId` | ID of the view we constrain |
| `int id` | ID of the view we constrain relative to |
| `int radius` | the radius of the circle in degrees |
| `float angle` | the angle |

### constrainDefaultHeight

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

```
public void constrainDefaultHeight(int viewId, int height)
```

Sets how the height is calculated ether MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD. Default is spread.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its matchConstraintDefaultHeight |
| `int height` | MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD |

### constrainDefaultWidth

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

```
public void constrainDefaultWidth(int viewId, int width)
```

Sets how the width is calculated ether MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD. Default is spread.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its matchConstraintDefaultWidth |
| `int width` | SPREAD or WRAP |

### constrainHeight

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

```
public void constrainHeight(int viewId, int height)
```

Sets the height of the view. It can be a dimension, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#WRAP_CONTENT()` or `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#MATCH_CONSTRAINT()`.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its height |
| `int height` | the height of the view |

### constrainMaxHeight

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

```
public void constrainMaxHeight(int viewId, int height)
```

Sets the maximum height of the view. It is a dimension, It is only applicable if height is #MATCH_CONSTRAINT}.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust it height |
| `int height` | the maximum height of the constraint |

### constrainMaxWidth

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

```
public void constrainMaxWidth(int viewId, int width)
```

Sets the maximum width of the view. It is a dimension, It is only applicable if width is #MATCH_CONSTRAINT}.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its max height |
| `int width` | the maximum width of the view |

### constrainMinHeight

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

```
public void constrainMinHeight(int viewId, int height)
```

Sets the height of the view. It is a dimension, It is only applicable if height is #MATCH_CONSTRAINT}.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its min height |
| `int height` | the minimum height of the view |

### constrainMinWidth

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

```
public void constrainMinWidth(int viewId, int width)
```

Sets the width of the view. It is a dimension, It is only applicable if width is #MATCH_CONSTRAINT}.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its min height |
| `int width` | the minimum width of the view |

### constrainPercentHeight

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

```
public void constrainPercentHeight(int viewId, float percent)
```

Sets the height of the view as a percentage of the parent.

| Parameters |
|---|---|
| `int viewId` |   |
| `float percent` |   |

### constrainPercentWidth

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

```
public void constrainPercentWidth(int viewId, float percent)
```

Sets the width of the view as a percentage of the parent.

| Parameters |
|---|---|
| `int viewId` |   |
| `float percent` |   |

### constrainWidth

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

```
public void constrainWidth(int viewId, int width)
```

Sets the width of the view. It can be a dimension, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#WRAP_CONTENT()` or `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#MATCH_CONSTRAINT()`.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its width |
| `int width` | the width of the view |

### constrainedHeight

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

```
public void constrainedHeight(int viewId, boolean constrained)
```

Sets how the height is calculated ether MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD. Default is spread.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its matchConstraintDefaultHeight |
| `boolean constrained` | if true height will be constrained |

### constrainedWidth

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

```
public void constrainedWidth(int viewId, boolean constrained)
```

Sets how the width is calculated ether MATCH_CONSTRAINT_WRAP or MATCH_CONSTRAINT_SPREAD. Default is spread.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its matchConstraintDefaultWidth |
| `boolean constrained` | if true with will be constrained |

### create

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

```
public void create(int guidelineID, int orientation)
```

Creates a ConstraintLayout virtual object. Currently only horizontal or vertical GuideLines.

| Parameters |
|---|---|
| `int guidelineID` | ID of guideline to create |
| `int orientation` | the Orientation of the guideline |

### createBarrier

```
public void createBarrier(int id, int direction, int margin, int[] referenced)
```

Creates a ConstraintLayout Barrier object.

| Parameters |
|---|---|
| `int id` |   |
| `int direction` | Barrier.{LEFT,RIGHT,TOP,BOTTOM,START,END} |
| `int[] referenced` |   |

### createHorizontalChain

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

```
public void createHorizontalChain(
    int leftId,
    int leftSide,
    int rightId,
    int rightSide,
    int[] chainIds,
    float[] weights,
    int style
)
```

Spaces a set of widgets horizontally between the view startID and endId. Widgets can be spaced with weights. This operation sets all the related margins to 0.

(for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#START()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#END()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#LEFT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#RIGHT()`)

| Parameters |
|---|---|
| `int leftId` | The id of the widget to connect to or PARENT_ID |
| `int leftSide` | the side of the start to connect to |
| `int rightId` | The id of the widget to connect to or PARENT_ID |
| `int rightSide` | the side of the right to connect to |
| `int[] chainIds` | The widgets in the chain |
| `float[] weights` | The weight to assign to each element in the chain or null |
| `int style` | The type of chain |

### createHorizontalChainRtl

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

```
public void createHorizontalChainRtl(
    int startId,
    int startSide,
    int endId,
    int endSide,
    int[] chainIds,
    float[] weights,
    int style
)
```

Spaces a set of widgets horizontal between the view startID and endId. Widgets can be spaced with weights. (for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#START()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#END()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#LEFT()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#RIGHT()`)

| Parameters |
|---|---|
| `int startId` | The id of the widget to connect to or PARENT_ID |
| `int startSide` | the side of the start to connect to |
| `int endId` | The id of the widget to connect to or PARENT_ID |
| `int endSide` | the side of the end to connect to |
| `int[] chainIds` | The widgets in the chain |
| `float[] weights` | The weight to assign to each element in the chain or null |
| `int style` | The type of chain |

### createVerticalChain

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

```
public void createVerticalChain(
    int topId,
    int topSide,
    int bottomId,
    int bottomSide,
    int[] chainIds,
    float[] weights,
    int style
)
```

Spaces a set of widgets vertically between the view topId and bottomId. Widgets can be spaced with weights. This operation sets all the related margins to 0.

(for sides see: `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#TOP()`, `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#BOTTOM()`)

| Parameters |
|---|---|
| `int topId` | The id of the widget to connect to or PARENT_ID |
| `int topSide` | the side of the start to connect to |
| `int bottomId` | The id of the widget to connect to or PARENT_ID |
| `int bottomSide` | the side of the right to connect to |
| `int[] chainIds` | widgets to use as a chain |
| `float[] weights` | can be null |
| `int style` | set the style of the chain |

### dump

```
public void dump(MotionScene scene, int[] ids)
```

Dump the contents

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionScene scene` |   |
| `int[] ids` |   |

### getApplyElevation

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

```
public boolean getApplyElevation(int viewId)
```

return with the constraint set will apply elevation for the specified view.

| Returns |
|---|---|
| `boolean` | true if the elevation will be set on this view (default is false) |

### getConstraint

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

```
public ConstraintSet.Constraint getConstraint(int id)
```

### getCustomAttributeSet

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

```
public HashMap<String, ConstraintAttribute> getCustomAttributeSet()
```

### getHeight

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

```
public int getHeight(int viewId)
```

Get the height set in the view

| Parameters |
|---|---|
| `int viewId` | the id of the view |

| Returns |
|---|---|
| `int` | return the height constraint of the view |

### getKnownIds

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

```
public int[] getKnownIds()
```

### getParameters

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

```
public ConstraintSet.Constraint getParameters(int mId)
```

| Parameters |
|---|---|
| `int mId` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint` |   |

### getReferencedIds

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

```
public int[] getReferencedIds(int id)
```

get the reference id's of a helper.

| Parameters |
|---|---|
| `int id` |   |

| Returns |
|---|---|
| `int[]` | array of id's |

### getStateLabels

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

```
public String[] getStateLabels()
```

Get the types associated with this ConstraintSet The types mechanism allows you to tag the constraint set with a series of string to define properties of a ConstraintSet

| Returns |
|---|---|
| `String[]` | an array of type strings |

### getVisibility

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

```
public int getVisibility(int viewId)
```

Get the visibility flag set in this view

| Parameters |
|---|---|
| `int viewId` | the id of the view |

| Returns |
|---|---|
| `int` | the visibility constraint for the view |

### getVisibilityMode

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

```
public int getVisibilityMode(int viewId)
```

ConstraintSet will not setVisibility. `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VISIBILITY_MODE_IGNORE()` or `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VISIBILITY_MODE_NORMAL()`.

| Parameters |
|---|---|
| `int viewId` | ID of view |

### getWidth

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

```
public int getWidth(int viewId)
```

Get the width set in the view

| Parameters |
|---|---|
| `int viewId` | the id of the view |

| Returns |
|---|---|
| `int` | return the width constraint of the view |

### isForceId

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

```
public boolean isForceId()
```

Enforce id are required for all ConstraintLayout children to use ConstraintSet. default = true;

### isValidateOnParse

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

```
public boolean isValidateOnParse()
```

If true perform validation checks when parsing ConstraintSets This will slow down parsing and should only be used for debugging

| Returns |
|---|---|
| `boolean` | validate |

### load

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

```
public void load(Context context, XmlPullParser parser)
```

Load a constraint set from a constraintSet.xml file

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | the context for the inflation |
| `https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser` | id of xml file in res/xml/ |

### load

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

```
public void load(Context context, int resourceId)
```

Load a constraint set from a constraintSet.xml file. Note. Do NOT use this to load a layout file. It will fail silently as there is no efficient way to differentiate.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | the context for the inflation |
| `int resourceId` | id of xml file in res/xml/ |

### matchesLabels

```
public boolean matchesLabels(String[] types)
```

Test if the list of strings matches labels defined on this constraintSet

| Parameters |
|---|---|
| `String[] types` | list of types |

| Returns |
|---|---|
| `boolean` | true if all types are in the labels |

### parseColorAttributes

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

```
public void parseColorAttributes(ConstraintSet.Constraint set, String attributes)
```

Parse color

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint set` |   |
| `https://developer.android.com/reference/java/lang/String.html attributes` |   |

### parseFloatAttributes

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

```
public void parseFloatAttributes(ConstraintSet.Constraint set, String attributes)
```

Parse floats

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint set` |   |
| `https://developer.android.com/reference/java/lang/String.html attributes` |   |

### parseIntAttributes

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

```
public void parseIntAttributes(ConstraintSet.Constraint set, String attributes)
```

Parse int

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint set` |   |
| `https://developer.android.com/reference/java/lang/String.html attributes` |   |

### parseStringAttributes

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

```
public void parseStringAttributes(ConstraintSet.Constraint set, String attributes)
```

Parse string

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet.Constraint set` |   |
| `https://developer.android.com/reference/java/lang/String.html attributes` |   |

### readFallback

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

```
public void readFallback(ConstraintLayout constraintLayout)
```

This will copy Constraints from the ConstraintLayout if it does not have parameters

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout constraintLayout` |   |

### readFallback

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

```
public void readFallback(ConstraintSet set)
```

This will copy Constraints from the ConstraintSet

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet set` |   |

### removeAttribute

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

```
public void removeAttribute(String attributeName)
```

Remove the attribute

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

### removeFromHorizontalChain

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

```
public void removeFromHorizontalChain(int viewId)
```

Removes a view from a horizontal chain. This assumes the view is connected to a horizontal chain. Its behaviour is undefined if not part of a horizontal chain.

| Parameters |
|---|---|
| `int viewId` | the view to be removed |

### removeFromVerticalChain

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

```
public void removeFromVerticalChain(int viewId)
```

Removes a view from a vertical chain. This assumes the view is connected to a vertical chain. Its behaviour is undefined if not part of a vertical chain.

| Parameters |
|---|---|
| `int viewId` | the view to be removed |

### setAlpha

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

```
public void setAlpha(int viewId, float alpha)
```

Adjust the alpha of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the vertical |
| `float alpha` | the alpha |

### setApplyElevation

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

```
public void setApplyElevation(int viewId, boolean apply)
```

set if elevation will be applied to the view. Elevation logic is based on style and animation. By default it is not used because it would lead to unexpected results.

| Parameters |
|---|---|
| `boolean apply` | true if this constraint set applies elevation to this view |

### setBarrierType

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

```
public void setBarrierType(int id, int type)
```

SEt tye type of barier

| Parameters |
|---|---|
| `int id` |   |
| `int type` |   |

### setColorValue

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

```
public void setColorValue(int viewId, String attributeName, int value)
```

Set the value of an attribute of type color

| Parameters |
|---|---|
| `int viewId` |   |
| `https://developer.android.com/reference/java/lang/String.html attributeName` |   |
| `int value` |   |

### setDimensionRatio

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

```
public void setDimensionRatio(int viewId, String ratio)
```

Constrains the views aspect ratio. For Example a HD screen is 16 by 9 = 16/(float)9 = 1.777f.

| Parameters |
|---|---|
| `int viewId` | ID of view to constrain |
| `https://developer.android.com/reference/java/lang/String.html ratio` | The ratio of the width to height (width / height) |

### setEditorAbsoluteX

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

```
public void setEditorAbsoluteX(int viewId, int position)
```

### setEditorAbsoluteY

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

```
public void setEditorAbsoluteY(int viewId, int position)
```

### setElevation

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

```
public void setElevation(int viewId, float elevation)
```

Adjust the elevation of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the elevation |
| `float elevation` | the elevation |

### setFloatValue

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

```
public void setFloatValue(int viewId, String attributeName, float value)
```

Set the value of an attribute of type float

| Parameters |
|---|---|
| `int viewId` |   |
| `https://developer.android.com/reference/java/lang/String.html attributeName` |   |
| `float value` |   |

### setForceId

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

```
public void setForceId(boolean forceId)
```

Enforce id are required for all ConstraintLayout children to use ConstraintSet. default = true;

| Parameters |
|---|---|
| `boolean forceId` |   |

### setGoneMargin

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

```
public void setGoneMargin(int viewId, int anchor, int value)
```

Sets the gone margin.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the margin on |
| `int anchor` | The side to adjust the margin on |
| `int value` | The new value for the margin |

### setGuidelineBegin

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

```
public void setGuidelineBegin(int guidelineID, int margin)
```

Set the guideline's distance form the top or left edge.

| Parameters |
|---|---|
| `int guidelineID` | ID of the guideline |
| `int margin` | the distance to the top or left edge |

### setGuidelineEnd

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

```
public void setGuidelineEnd(int guidelineID, int margin)
```

Set a guideline's distance to end.

| Parameters |
|---|---|
| `int guidelineID` | ID of the guideline |
| `int margin` | the margin to the right or bottom side of container |

### setGuidelinePercent

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

```
public void setGuidelinePercent(int guidelineID, float ratio)
```

Set a Guideline's percent.

| Parameters |
|---|---|
| `int guidelineID` | ID of the guideline |
| `float ratio` | the ratio between the gap on the left and right 0.0 is top/left 0.5 is middle |

### setHorizontalBias

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

```
public void setHorizontalBias(int viewId, float bias)
```

Adjust the horizontal bias of the view (used with views constrained on left and right).

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the horizontal |
| `float bias` | the new bias 0.5 is in the middle |

### setHorizontalChainStyle

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

```
public void setHorizontalChainStyle(int viewId, int chainStyle)
```

How the elements of the horizontal chain will be positioned. if the dimension behaviour is set to MATCH_CONSTRAINT. The possible values are:

- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#CHAIN_SPREAD()` -- the elements will be spread out
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#CHAIN_SPREAD_INSIDE()` -- similar, but the endpoints of the chain will not be spread out
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#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

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its HorizontalChainStyle |
| `int chainStyle` | the weight that we can use to distribute the horizontal space |

### setHorizontalWeight

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

```
public void setHorizontalWeight(int viewId, float weight)
```

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

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its HorizontalWeight |
| `float weight` | the weight that we can use to distribute the horizontal space |

### setIntValue

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

```
public void setIntValue(int viewId, String attributeName, int value)
```

Set the value of an attribute of type int

| Parameters |
|---|---|
| `int viewId` |   |
| `https://developer.android.com/reference/java/lang/String.html attributeName` |   |
| `int value` |   |

### setLayoutWrapBehavior

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

```
public void setLayoutWrapBehavior(int viewId, int behavior)
```

Sets the wrap behavior of the widget in the parent's wrap computation

### setMargin

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

```
public void setMargin(int viewId, int anchor, int value)
```

Sets the margin.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the margin on |
| `int anchor` | The side to adjust the margin on |
| `int value` | The new value for the margin |

### setReferencedIds

```
public void setReferencedIds(int id, int[] referenced)
```

sets the reference id's of a barrier.

| Parameters |
|---|---|
| `int id` |   |
| `int[] referenced` |   |

### setRotation

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

```
public void setRotation(int viewId, float rotation)
```

Adjust the post-layout rotation about the Z axis of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust th Z rotation |
| `float rotation` | the rotation about the X axis |

### setRotationX

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

```
public void setRotationX(int viewId, float rotationX)
```

Adjust the post-layout rotation about the X axis of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust th X rotation |
| `float rotationX` | the rotation about the X axis |

### setRotationY

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

```
public void setRotationY(int viewId, float rotationY)
```

Adjust the post-layout rotation about the Y axis of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the Y rotation |
| `float rotationY` | the rotationY |

### setScaleX

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

```
public void setScaleX(int viewId, float scaleX)
```

Adjust the post-layout scale in X of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the scale in X |
| `float scaleX` | the scale in X |

### setScaleY

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

```
public void setScaleY(int viewId, float scaleY)
```

Adjust the post-layout scale in Y of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the scale in Y |
| `float scaleY` | the scale in Y |

### setStateLabels

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

```
public void setStateLabels(String types)
```

Set the types associated with this ConstraintSet The types mechanism allows you to tag the constraint set with a series of string to define properties of a ConstraintSet

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html types` | a comer separated array of strings. |

### setStateLabelsList

```
public void setStateLabelsList(String[] types)
```

Set the types associated with this ConstraintSet The types mechanism allows you to tag the constraint set with a series of string to define properties of a ConstraintSet

| Parameters |
|---|---|
| `String[] types` | a comer separated array of strings. |

### setStringValue

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

```
public void setStringValue(int viewId, String attributeName, String value)
```

Set the value of an attribute of type string

| Parameters |
|---|---|
| `int viewId` |   |
| `https://developer.android.com/reference/java/lang/String.html attributeName` |   |
| `https://developer.android.com/reference/java/lang/String.html value` |   |

### setTransformPivot

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

```
public void setTransformPivot(
    int viewId,
    float transformPivotX,
    float transformPivotY
)
```

Set X,Y location of the pivot point around which the view will rotate and scale. use Float.NaN to clear the pivot value. Note: once an actual View has had its pivot set it cannot be cleared.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the transforms pivot point |
| `float transformPivotX` | X location of the pivot point. |
| `float transformPivotY` | Y location of the pivot point. |

### setTransformPivotX

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

```
public void setTransformPivotX(int viewId, float transformPivotX)
```

Set X location of the pivot point around which the view will rotate and scale. use Float.NaN to clear the pivot value. Note: once an actual View has had its pivot set it cannot be cleared.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the transforms pivot point about X |
| `float transformPivotX` | X location of the pivot point. |

### setTransformPivotY

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

```
public void setTransformPivotY(int viewId, float transformPivotY)
```

Set Y location of the pivot point around which the view will rotate and scale. use Float.NaN to clear the pivot value. Note: once an actual View has had its pivot set it cannot be cleared.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the transforms pivot point about Y |
| `float transformPivotY` | Y location of the pivot point. |

### setTranslation

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

```
public void setTranslation(int viewId, float translationX, float translationY)
```

Adjust the post-layout translation of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its translation in X \&Y |
| `float translationX` | the translation in X |
| `float translationY` | the translation in Y |

### setTranslationX

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

```
public void setTranslationX(int viewId, float translationX)
```

Adjust the post-layout X translation of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to translate in X |
| `float translationX` | the translation in X |

### setTranslationY

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

```
public void setTranslationY(int viewId, float translationY)
```

Adjust the post-layout Y translation of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to to translate in Y |
| `float translationY` | the translation in Y |

### setTranslationZ

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

```
public void setTranslationZ(int viewId, float translationZ)
```

Adjust the translation in Z of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust |
| `float translationZ` | the translationZ |

### setValidateOnParse

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

```
public void setValidateOnParse(boolean validate)
```

If true perform validation checks when parsing ConstraintSets This will slow down parsing and should only be used for debugging

| Parameters |
|---|---|
| `boolean validate` |   |

### setVerticalBias

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

```
public void setVerticalBias(int viewId, float bias)
```

Adjust the vertical bias of the view (used with views constrained on left and right).

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the vertical |
| `float bias` | the new bias 0.5 is in the middle |

### setVerticalChainStyle

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

```
public void setVerticalChainStyle(int viewId, int chainStyle)
```

How the elements of the vertical chain will be positioned. in a chain, if the dimension behaviour is set to MATCH_CONSTRAINT

- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#CHAIN_SPREAD()` -- the elements will be spread out
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#CHAIN_SPREAD_INSIDE()` -- similar, but the endpoints of the chain will not be spread out
- `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#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

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its VerticalChainStyle |
| `int chainStyle` | the weight that we can use to distribute the horizontal space |

### setVerticalWeight

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

```
public void setVerticalWeight(int viewId, float weight)
```

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

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust its VerticalWeight |
| `float weight` | the weight that we can use to distribute the vertical space |

### setVisibility

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

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

Adjust the visibility of a view.

| Parameters |
|---|---|
| `int viewId` | ID of view to adjust the vertical |
| `int visibility` | the visibility |

### setVisibilityMode

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

```
public void setVisibilityMode(int viewId, int visibilityMode)
```

ConstraintSet will not setVisibility. `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VISIBILITY_MODE_IGNORE()` or `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintSet#VISIBILITY_MODE_NORMAL()`.

| Parameters |
|---|---|
| `int viewId` | ID of view |
| `int visibilityMode` |   |

### writeState

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

```
public void writeState(Writer writer, ConstraintLayout layout, int flags)
```

Write the state to a Writer

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/io/Writer.html writer` |   |
| `https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout layout` |   |
| `int flags` |   |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` |   |