# PrimaryLayoutMargins

Artifact: [androidx.wear.protolayout:protolayout-material3](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/material3/PrimaryLayoutMargins.kt+class:androidx.wear.protolayout.material3.PrimaryLayoutMargins) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

*** ** * ** ***


```
public abstract class PrimaryLayoutMargins
```

<br />

*** ** * ** ***

The set of margins for the `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)`'s customization, represented as fraction of the screen size.

It is highly recommended to use these predefined values that are optimized for different screen sizes, content's corners and slots presences. Those are:

- `https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins#MIN_PRIMARY_LAYOUT_MARGIN()`

- `https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins#MID_PRIMARY_LAYOUT_MARGIN()`

- `https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins#DEFAULT_PRIMARY_LAYOUT_MARGIN()`

- `https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins#MAX_PRIMARY_LAYOUT_MARGIN()`.

## Summary

| ### Nested types |
|---|
| `public static class https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins.Companion` |

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins` | `https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins#DEFAULT_PRIMARY_LAYOUT_MARGIN()` Default side margins for the main slot of `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` that works for the majority of `https://developer.android.com/reference/androidx/wear/protolayout/material3/Shapes` inside the main content components, usually across round toward medium round corners. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins` | `https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins#MAX_PRIMARY_LAYOUT_MARGIN()` Max side margins for the main slot of `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` that should be used when the main slot contains content components with square corners, for example, smaller than `https://developer.android.com/reference/androidx/wear/protolayout/material3/Shapes#medium()` to avoid clipping. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins` | `https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins#MID_PRIMARY_LAYOUT_MARGIN()` Mid side margins for the main slot of `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` that should be used when the main slot contains content components with fully rounded to medium round corners, for example, larger than `https://developer.android.com/reference/androidx/wear/protolayout/material3/Shapes#medium()` to avoid clipping. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins` | `https://developer.android.com/reference/androidx/wear/protolayout/material3/PrimaryLayoutMargins#MIN_PRIMARY_LAYOUT_MARGIN()` Min side margins for the main slot of `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` that should be used only when the main slot contains content components with fully rounded corners, such as `https://developer.android.com/reference/androidx/wear/protolayout/material3/Shapes#full()` to avoid clipping. |

## Public fields

### DEFAULT_PRIMARY_LAYOUT_MARGIN

```
public static final @NonNull PrimaryLayoutMargins DEFAULT_PRIMARY_LAYOUT_MARGIN
```

Default side margins for the main slot of `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` that works for the majority of `https://developer.android.com/reference/androidx/wear/protolayout/material3/Shapes` inside the main content components, usually across round toward medium round corners.

The actual returned values depend on presence of slots in `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` which will be applied automatically.

### MAX_PRIMARY_LAYOUT_MARGIN

```
public static final @NonNull PrimaryLayoutMargins MAX_PRIMARY_LAYOUT_MARGIN
```

Max side margins for the main slot of `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` that should be used when the main slot contains content components with square corners, for example, smaller than `https://developer.android.com/reference/androidx/wear/protolayout/material3/Shapes#medium()` to avoid clipping.

The actual returned values depend on presence of slots in `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` which will be applied automatically.

### MID_PRIMARY_LAYOUT_MARGIN

```
public static final @NonNull PrimaryLayoutMargins MID_PRIMARY_LAYOUT_MARGIN
```

Mid side margins for the main slot of `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` that should be used when the main slot contains content components with fully rounded to medium round corners, for example, larger than `https://developer.android.com/reference/androidx/wear/protolayout/material3/Shapes#medium()` to avoid clipping.

The actual returned values depend on presence of slots in `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` which will be applied automatically.

### MIN_PRIMARY_LAYOUT_MARGIN

```
public static final @NonNull PrimaryLayoutMargins MIN_PRIMARY_LAYOUT_MARGIN
```

Min side margins for the main slot of `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` that should be used only when the main slot contains content components with fully rounded corners, such as `https://developer.android.com/reference/androidx/wear/protolayout/material3/Shapes#full()` to avoid clipping.

The actual returned values depend on presence of slots in `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#(androidx.wear.protolayout.material3.MaterialScope).primaryLayout(kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.protolayout.ModifiersBuilders.Clickable,androidx.wear.protolayout.material3.PrimaryLayoutMargins)` which will be applied automatically.