# SplitAttributes

# SplitAttributes

Artifact:[androidx.window:window](https://developer.android.com/jetpack/androidx/releases/window)  
[View Source](https://cs.android.com/search?q=file:androidx/window/embedding/SplitAttributes.kt+class:androidx.window.embedding.SplitAttributes)  
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/SplitAttributes "View this page in Java")

<br />

```
class SplitAttributes
```

<br />

*** ** * ** ***

Attributes that describe how the parent window (typically the activity task window) is split between the primary and secondary activity containers, including:

- Split type --- Categorizes the split and specifies the sizes of the primary and secondary activity containers relative to the parent bounds

- Layout direction --- Specifies whether the parent window is split vertically or horizontally and in which direction the primary and secondary containers are respectively positioned (left to right, right to left, top to bottom, and so forth)

- Animation params --- The parameters for the animation of the split involving this`SplitAttributes`object

- Divider attributes --- Specifies whether a divider is needed between the split containers and the properties of the divider, including the color, the width, whether the divider is draggable, etc.

Attributes can be configured by:

- Setting the default`SplitAttributes`using[SplitPairRule.Builder.setDefaultSplitAttributes](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPairRule.Builder#setDefaultSplitAttributes(androidx.window.embedding.SplitAttributes))or[SplitPlaceholderRule.Builder.setDefaultSplitAttributes](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitPlaceholderRule.Builder#setDefaultSplitAttributes(androidx.window.embedding.SplitAttributes)).

- Setting`splitRatio`,`splitLayoutDirection`, and`animationParams`attributes in`<SplitPairRule>`or`<SplitPlaceholderRule>`tags in an XML configuration file. The attributes are parsed as[SplitType](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.SplitType),[LayoutDirection](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.LayoutDirection), and[EmbeddingAnimationParams](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams), respectively. Note that[SplitType.SPLIT_TYPE_HINGE](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.SplitType#SPLIT_TYPE_HINGE())is not supported XML format.

- Using[SplitController.setSplitAttributesCalculator](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitController#setSplitAttributesCalculator(kotlin.Function1))to customize the`SplitAttributes`for a given device and window state.

|                                                                  See also                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------|---|
| [SplitAttributes.Builder](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.Builder)                 |   |
| [SplitAttributes.SplitType](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.SplitType)             |   |
| [SplitAttributes.LayoutDirection](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.LayoutDirection) |   |
| [EmbeddingAnimationParams](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams)               |   |

## Summary

|                                                                                                                                   ### Nested types                                                                                                                                    |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[SplitAttributes.Builder](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.Builder) Builder for creating an instance of[SplitAttributes](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes).   |
| `class `[SplitAttributes.LayoutDirection](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.LayoutDirection) The layout direction of the primary and secondary activity containers.                                                            |
| `class `[SplitAttributes.SplitType](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.SplitType) The type of parent window split, which defines the proportion of the parent window occupied by the primary and secondary activity containers. |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` Determines whether this object has the same split attributes as the compared object. |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes#hashCode())`()` Returns a hash code for this`SplitAttributes`object.                                                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes#toString())`()` A string representation of this`SplitAttributes`object.                                                                                                                         |

|                                                            ### Public properties                                                            |
|---------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [EmbeddingAnimationParams](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams)               | [animationParams](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes#animationParams()) The animation params to specify the animation transitions of the split involving this`SplitAttributes`object.                         |
| [DividerAttributes](https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes)                             | [dividerAttributes](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes#dividerAttributes()) The[DividerAttributes](https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes)for this split. |
| [SplitAttributes.LayoutDirection](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.LayoutDirection) | [layoutDirection](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes#layoutDirection()) The layout direction of the parent window split.                                                                                      |
| [SplitAttributes.SplitType](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes.SplitType)             | [splitType](https://developer.android.com/reference/kotlin/androidx/window/embedding/SplitAttributes#splitType()) The split type attribute.                                                                                                                         |

## Public functions

### equals

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

Determines whether this object has the same split attributes as the compared object.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|---------------------------------------|
| `other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?` | The object to compare to this object. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | True if the objects have the same split attributes, false otherwise. |

### hashCode

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

Returns a hash code for this`SplitAttributes`object.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|--------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The hash code for this object. |

### toString

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

A string representation of this`SplitAttributes`object.  

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | The string representation of the object. |

## Public properties

### animationParams

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

```
val animationParams: EmbeddingAnimationParams
```

The animation params to specify the animation transitions of the split involving this`SplitAttributes`object. The default is to use the current theme window background color and system transitions.  

### dividerAttributes

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

```
val dividerAttributes: DividerAttributes
```

The[DividerAttributes](https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes)for this split. Defaults to[DividerAttributes.NO_DIVIDER](https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes#NO_DIVIDER()), which means no divider is requested.  

### layoutDirection

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

```
val layoutDirection: SplitAttributes.LayoutDirection
```

The layout direction of the parent window split. The default is based on locale value.  

### splitType

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

```
val splitType: SplitAttributes.SplitType
```

The split type attribute. Defaults to an equal split of the parent window for the primary and secondary containers.