# SplitPairRule

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

*** ** * ** ***

<br />

```
class SplitPairRule : SplitRule
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [androidx.window.embedding.EmbeddingRule](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingRule) |||
|   | ↳ | [androidx.window.embedding.SplitRule](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule) ||
|   |   | ↳ | [androidx.window.embedding.SplitPairRule](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule) |

*** ** * ** ***

Split configuration rules for activity pairs. Define when activities that were launched on top should be placed adjacent to the one below, and the visual properties of such splits. Can be set either by `https://developer.android.com/reference/kotlin/androidx/window/embedding/RuleController#setRules(kotlin.collections.Set)` or `https://developer.android.com/reference/kotlin/androidx/window/embedding/RuleController#addRule(androidx.window.embedding.EmbeddingRule)`. The rules are always applied only to activities that will be started from the activity fills the whole parent task container or activity in the primary split after the rules were set.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule`. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule#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/SplitPairRule#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule#clearTop()` If there is an existing split with the same primary container, indicates whether the existing secondary container on top and all activities in it should be destroyed when a new split is created using this rule. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairFilter>` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule#filters()` Filters used to choose when to apply this rule. |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule.FinishBehavior` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule#finishPrimaryWithSecondary()` Determines what happens with the primary container when all activities are finished in the associated secondary container. |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule.FinishBehavior` | `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule#finishSecondaryWithPrimary()` Determines what happens with the secondary container when all activities are finished in the associated primary container. |

### Inherited properties

From [androidx.window.embedding.EmbeddingRule](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingRule) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingRule#tag()`

A unique string to identify this `https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingRule`, which defaults to `null`.
From [androidx.window.embedding.SplitRule](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule) `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes` `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#defaultSplitAttributes()`

The default `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes` to apply on the activity containers pair when the host task bounds satisfy `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#(kotlin.String,kotlin.Int,kotlin.Int,kotlin.Int,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.SplitAttributes)`, `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#(kotlin.String,kotlin.Int,kotlin.Int,kotlin.Int,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.SplitAttributes)`, `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#(kotlin.String,kotlin.Int,kotlin.Int,kotlin.Int,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.SplitAttributes)`, `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#(kotlin.String,kotlin.Int,kotlin.Int,kotlin.Int,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.SplitAttributes)` and `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#(kotlin.String,kotlin.Int,kotlin.Int,kotlin.Int,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.EmbeddingAspectRatio,androidx.window.embedding.SplitAttributes)` requirements.
`https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#maxAspectRatioInLandscape()`

The largest value of the aspect ratio, expressed as `width / height` in decimal form, of the parent window bounds in landscape when the split should be used.
`https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAspectRatio` `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#maxAspectRatioInPortrait()`

The largest value of the aspect ratio, expressed as `height / width` in decimal form, of the parent window bounds in portrait when the split should be used.
`@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#minHeightDp()`

The smallest value of height of the parent task window when the split should be used, in DP.
`@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#minSmallestWidthDp()`

The smallest value of the smallest possible width of the parent task window in any rotation when the split should be used, in DP.
`@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule#minWidthDp()`

The smallest value of width of the parent task window when the split should be used, in DP.

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### clearTop

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

```
val clearTop: Boolean
```

If there is an existing split with the same primary container, indicates whether the existing secondary container on top and all activities in it should be destroyed when a new split is created using this rule. Otherwise the new secondary will appear on top by default.

### filters

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

```
val filters: Set<SplitPairFilter>
```

Filters used to choose when to apply this rule. The rule may be used if any one of the provided filters matches.

### finishPrimaryWithSecondary

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

```
val finishPrimaryWithSecondary: SplitRule.FinishBehavior
```

Determines what happens with the primary container when all activities are finished in the associated secondary container.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule.FinishBehavior#NEVER()` |   |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule.FinishBehavior#ALWAYS()` |   |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule.FinishBehavior#ADJACENT()` |   |

### finishSecondaryWithPrimary

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

```
val finishSecondaryWithPrimary: SplitRule.FinishBehavior
```

Determines what happens with the secondary container when all activities are finished in the associated primary container.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule.FinishBehavior#NEVER()` |   |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule.FinishBehavior#ALWAYS()` |   |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitRule.FinishBehavior#ADJACENT()` |   |