# EmbeddingAspectRatio

Artifact: [androidx.window:window](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/embedding/EmbeddingAspectRatio.kt+class:androidx.window.embedding.EmbeddingAspectRatio) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/window#1.1.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/window/embedding/EmbeddingAspectRatio "View this page in Java")


```
class EmbeddingAspectRatio
```

<br />

*** ** * ** ***

The aspect ratio of the parent window bound to allow embedding with the rule.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#maxAspectRatioInPortrait()` |   |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#maxAspectRatioInLandscape()` |   |

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#ratio(kotlin.Float)(ratio: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 1.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` For max aspect ratio, when the aspect ratio is greater than this value, it means to disallow embedding. |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#ALWAYS_ALLOW()` Gets the special `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` to represent it always allows embedding. |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#ALWAYS_DISALLOW()` Gets the special `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` to represent it always disallows embedding. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#toString()()` |

## Public companion functions

### ratio

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

```
fun ratio(ratio: @FloatRange(from = 1.0, fromInclusive = false) Float): EmbeddingAspectRatio
```

For max aspect ratio, when the aspect ratio is greater than this value, it means to disallow embedding.

For min aspect ratio, when the aspect ratio is smaller than this value, it means to disallow embedding.

Values smaller than or equal to `1` are invalid.

| Parameters |
|---|---|
| `ratio: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 1.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the aspect ratio. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` | the `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` representing the `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#ratio(kotlin.Float)`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#ALWAYS_ALLOW()` | for always allow embedding. |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio#ALWAYS_DISALLOW()` | for always disallow embedding. |

## Public companion properties

### ALWAYS_ALLOW

```
val ALWAYS_ALLOW: EmbeddingAspectRatio
```

Gets the special `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` to represent it always allows embedding.

An example use case is to set it on `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#maxAspectRatioInLandscape()` if the app wants to always allow embedding as split when the parent window is in landscape.

### ALWAYS_DISALLOW

```
val ALWAYS_DISALLOW: EmbeddingAspectRatio
```

Gets the special `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` to represent it always disallows embedding.

An example use case is to set it on `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#maxAspectRatioInPortrait()` if the app wants to disallow embedding as split when the parent window is in portrait.

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

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