# Direct

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

*** ** * ** ***


```
class Direct
```

<br />

*** ** * ** ***

Direct resolution engine This walks through the graph of dependencies and infer final position. This allows us to skip the linear solver in many situations, as well as skipping intermediate measure passes. Widgets are solved independently in horizontal and vertical. Any widgets not fully resolved will be computed later on by the linear solver.

## Summary

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

| ### Public functions |
|---|---|
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/Direct#ls(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Small utility function to indent logs depending on the level |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/Direct#solveChain(androidx.constraintlayout.core.widgets.ConstraintWidgetContainer,androidx.constraintlayout.core.LinearSystem,int,int,androidx.constraintlayout.core.widgets.ChainHead,boolean,boolean,boolean)( container: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer!, system: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/LinearSystem!, orientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, chainHead: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ChainHead!, isChainSpread: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, isChainSpreadInside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, isChainPacked: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Try to directly resolve the chain |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/Direct#solvingPass(androidx.constraintlayout.core.widgets.ConstraintWidgetContainer,androidx.constraintlayout.core.widgets.analyzer.BasicMeasure.Measurer)( layout: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer!, measurer: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/BasicMeasure.Measurer! )` Walk the dependency graph and solves it. |

## Public constructors

### Direct

Added in 1.1.2

```
Direct()
```

## Public functions

### ls

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

```
java-static fun ls(level: Int): String!
```

Small utility function to indent logs depending on the level

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | a formatted string for the indentation |

### solveChain

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

```
java-static fun solveChain(
    container: ConstraintWidgetContainer!,
    system: LinearSystem!,
    orientation: Int,
    offset: Int,
    chainHead: ChainHead!,
    isChainSpread: Boolean,
    isChainSpreadInside: Boolean,
    isChainPacked: Boolean
): Boolean
```

Try to directly resolve the chain

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

### solvingPass

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

```
java-static fun solvingPass(
    layout: ConstraintWidgetContainer!,
    measurer: BasicMeasure.Measurer!
): Unit
```

Walk the dependency graph and solves it.

| Parameters |
|---|---|
| `layout: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer!` | the container we want to optimize |
| `measurer: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/widgets/analyzer/BasicMeasure.Measurer!` | the measurer used to measure the widget |