# DependencyGraph

Artifact: [androidx.constraintlayout:constraintlayout-core](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/core/widgets/analyzer/DependencyGraph.java+class:androidx.constraintlayout.core.widgets.analyzer.DependencyGraph) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***


```
class DependencyGraph
```

<br />

*** ** * ** ***

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#DependencyGraph(androidx.constraintlayout.core.widgets.ConstraintWidgetContainer)(container: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#buildGraph()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#buildGraph(java.util.ArrayList<androidx.constraintlayout.core.widgets.analyzer.WidgetRun>)(runs: https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/WidgetRun!>!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#defineTerminalWidgets(androidx.constraintlayout.core.widgets.ConstraintWidget.DimensionBehaviour,androidx.constraintlayout.core.widgets.ConstraintWidget.DimensionBehaviour)( horizontalBehavior: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour!, verticalBehavior: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidget.DimensionBehaviour! )` Find and mark terminal widgets (trailing widgets) -- they are the only ones we need to care for wrap_content checks |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#directMeasure(boolean)(optimizeWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Try to measure the layout by solving the graph of constraints directly |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#directMeasureSetup(boolean)(optimizeWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#directMeasureWithOrientation(boolean,int)(optimizeWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, orientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#invalidateGraph()()` Invalidate the graph of constraints |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#invalidateMeasures()()` Mark the widgets as needing to be remeasured |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#measureWidgets()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/DependencyGraph#setMeasurer(androidx.constraintlayout.core.widgets.analyzer.BasicMeasure.Measurer)(measurer: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/BasicMeasure.Measurer!)` |

## Public constructors

### DependencyGraph

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

```
DependencyGraph(container: ConstraintWidgetContainer!)
```

## Public functions

### buildGraph

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

```
fun buildGraph(): Unit
```

### buildGraph

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

```
fun buildGraph(runs: ArrayList<WidgetRun!>!): Unit
```

### defineTerminalWidgets

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

```
fun defineTerminalWidgets(
    horizontalBehavior: ConstraintWidget.DimensionBehaviour!,
    verticalBehavior: ConstraintWidget.DimensionBehaviour!
): Unit
```

Find and mark terminal widgets (trailing widgets) -- they are the only ones we need to care for wrap_content checks

### directMeasure

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

```
fun directMeasure(optimizeWrap: Boolean): Boolean
```

Try to measure the layout by solving the graph of constraints directly

| Parameters |
|---|---|
| `optimizeWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | use the wrap_content optimizer |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if all widgets have been resolved |

### directMeasureSetup

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

```
fun directMeasureSetup(optimizeWrap: Boolean): Boolean
```

### directMeasureWithOrientation

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

```
fun directMeasureWithOrientation(optimizeWrap: Boolean, orientation: Int): Boolean
```

### invalidateGraph

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

```
fun invalidateGraph(): Unit
```

Invalidate the graph of constraints

### invalidateMeasures

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

```
fun invalidateMeasures(): Unit
```

Mark the widgets as needing to be remeasured

### measureWidgets

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

```
fun measureWidgets(): Unit
```

### setMeasurer

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

```
fun setMeasurer(measurer: BasicMeasure.Measurer!): Unit
```