# GridFlag

Artifact: [androidx.constraintlayout:constraintlayout-compose](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/compose/ConstraintLayoutBaseScope.kt+class:androidx.constraintlayout.compose.GridFlag) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)


```
value class GridFlag
```

<br />

*** ** * ** ***

Set of individual options that may change the Grid helper behavior, each flag can be combined with the `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#or(androidx.constraintlayout.compose.GridFlag)` operator.

By default, the Grid helper places its `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/LayoutReference`s as given in the `elements` parameter. Following arrangement rules (skips, spans and orientation).

However, when `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#isPlaceLayoutsOnSpansFirst()` is `true`. The given `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/LayoutReference`s will be first placed on the cells occupied by the given `spans` array. Then, the remaining layouts are placed on the remaining cells following typical arrangement rules.

For example, on a grid layout with 1 row and 3 columns, placing two widgets: w0, w1, with a span defined as `Span(position = 1, rows = 1, columns = 2)`. The grid layout by default would place them as `[w0 w1 w1]`. Whereas when `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#isPlaceLayoutsOnSpansFirst()` is `true`, they'd be placed as `[w1 w0 w0]`.

In some situations, `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#isPlaceLayoutsOnSpansFirst()` can make it easier to match the desired layouts with the given spans on the Grid.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/ConstraintLayoutBaseScope#createGrid(kotlin.Array,kotlin.Int,kotlin.Int,kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.FloatArray,kotlin.FloatArray,kotlin.Array,kotlin.Array,androidx.constraintlayout.compose.GridFlag)` |   |

## Summary

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#None()` All default behaviors apply. |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#PlaceLayoutsOnSpansFirst()` Creates a `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag` instance with `isPlaceLayoutsOnSpansFirst` as `true`. |

| ### Public functions |
|---|---|
| `infix https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#or(androidx.constraintlayout.compose.GridFlag)(other: https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag)` `or` operator override to allow combining flags |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag#isPlaceLayoutsOnSpansFirst()` When true, the Grid helper will first place Layouts on cells occupied by spans, then fill the remaining cells following the typical arrangement rules. |

## Public companion properties

### None

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

```
val None: GridFlag
```

All default behaviors apply.

### PlaceLayoutsOnSpansFirst

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

```
val PlaceLayoutsOnSpansFirst: GridFlag
```

Creates a `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/GridFlag` instance with `isPlaceLayoutsOnSpansFirst` as `true`.

Making it so that when placing the layouts, they are first placed on cells occupied by spans, then, any remaining layouts are placed on the remaining cells following the typical arrangement rules.

## Public functions

### or

```
infix fun or(other: GridFlag): GridFlag
```

`or` operator override to allow combining flags

### toString

```
open fun toString(): String
```

## Public properties

### isPlaceLayoutsOnSpansFirst

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

```
val isPlaceLayoutsOnSpansFirst: Boolean
```

When true, the Grid helper will first place Layouts on cells occupied by spans, then fill the remaining cells following the typical arrangement rules.