SplitAttributes.Builder


class SplitAttributes.Builder


Builder for creating an instance of SplitAttributes.

  • The default split type is an equal split between primary and secondary containers.

  • The default layout direction is based on locale.

  • The default animation background color is to use the current theme window background color.

  • The default divider attributes is not to use divider.

Summary

Public constructors

Public functions

SplitAttributes

Builds a SplitAttributes instance with the attributes specified by setSplitType, setLayoutDirection, and setAnimationParams.

SplitAttributes.Builder

Sets the animation params to use during animation of the split involving this SplitAttributes object if the animation requires a background.

SplitAttributes.Builder

Sets the DividerAttributes for this split.

SplitAttributes.Builder

Sets the split layout direction attribute.

SplitAttributes.Builder

Sets the split type attribute.

Public constructors

Builder

Added in 1.1.0
Builder()

Public functions

build

Added in 1.1.0
fun build(): SplitAttributes

Builds a SplitAttributes instance with the attributes specified by setSplitType, setLayoutDirection, and setAnimationParams.

Returns
SplitAttributes

The new SplitAttributes instance.

setAnimationParams

Added in 1.4.0-beta01
@RequiresWindowSdkExtension(version = 5)
fun setAnimationParams(params: EmbeddingAnimationParams): SplitAttributes.Builder

Sets the animation params to use during animation of the split involving this SplitAttributes object if the animation requires a background.

The default is to use the current theme window background color.

EmbeddingAnimationParams can be supported only if the Window Extensions version of the target device is equals or higher than required API level. Otherwise, it would be no-op when setting the EmbeddingAnimationParams on a target device that has lower API level.

Parameters
params: EmbeddingAnimationParams

The animation params.

Returns
SplitAttributes.Builder

This Builder.

setDividerAttributes

Added in 1.4.0-beta01
@RequiresWindowSdkExtension(version = 6)
fun setDividerAttributes(dividerAttributes: DividerAttributes): SplitAttributes.Builder

Sets the DividerAttributes for this split.

The default is DividerAttributes.NO_DIVIDER, which means no divider is requested.

Divider can be supported only if the Window Extensions version of the target device is equals or higher than required API level. Otherwise, it would be no-op on a target device that has lower API level.

Parameters
dividerAttributes: DividerAttributes

The divider attributes.

Returns
SplitAttributes.Builder

This Builder.

setLayoutDirection

Added in 1.1.0
fun setLayoutDirection(layoutDirection: SplitAttributes.LayoutDirection): SplitAttributes.Builder

Sets the split layout direction attribute.

The default is based on locale.

Parameters
layoutDirection: SplitAttributes.LayoutDirection

The layout direction attribute.

Returns
SplitAttributes.Builder

This Builder.

setSplitType

Added in 1.1.0
fun setSplitType(type: SplitAttributes.SplitType): SplitAttributes.Builder

Sets the split type attribute.

The default is an equal split between primary and secondary containers.

Parameters
type: SplitAttributes.SplitType

The split type attribute.

Returns
SplitAttributes.Builder

This Builder.