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

*** ** * ** ***


```
public 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/androidx/constraintlayout/core/widgets/analyzer/Direct#Direct()()` |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/analyzer/Direct#ls(int)(int level)` Small utility function to indent logs depending on the level |
| `static boolean` | `https://developer.android.com/reference/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)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer container, https://developer.android.com/reference/androidx/constraintlayout/core/LinearSystem system, int orientation, int offset, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ChainHead chainHead, boolean isChainSpread, boolean isChainSpreadInside, boolean isChainPacked )` Try to directly resolve the chain |
| `static void` | `https://developer.android.com/reference/androidx/constraintlayout/core/widgets/analyzer/Direct#solvingPass(androidx.constraintlayout.core.widgets.ConstraintWidgetContainer,androidx.constraintlayout.core.widgets.analyzer.BasicMeasure.Measurer)( https://developer.android.com/reference/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer layout, https://developer.android.com/reference/androidx/constraintlayout/core/widgets/analyzer/BasicMeasure.Measurer measurer )` Walk the dependency graph and solves it. |

## Public constructors

### Direct

Added in 1.1.2

```
public Direct()
```

## Public methods

### ls

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

```
public static String ls(int level)
```

Small utility function to indent logs depending on the level

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | a formatted string for the indentation |

### solveChain

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

```
public static boolean solveChain(
    ConstraintWidgetContainer container,
    LinearSystem system,
    int orientation,
    int offset,
    ChainHead chainHead,
    boolean isChainSpread,
    boolean isChainSpreadInside,
    boolean isChainPacked
)
```

Try to directly resolve the chain

| Returns |
|---|---|
| `boolean` | true if fully resolved |

### solvingPass

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

```
public static void solvingPass(
    ConstraintWidgetContainer layout,
    BasicMeasure.Measurer measurer
)
```

Walk the dependency graph and solves it.

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