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 setAnimationBackground.

SplitAttributes.Builder

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

SplitAttributes.Builder

Sets the DividerAttributes.

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 setAnimationBackground.

Returns
SplitAttributes

The new SplitAttributes instance.

setAnimationBackground

Added in 1.4.0-alpha05
@RequiresWindowSdkExtension(version = 5)
fun setAnimationBackground(background: EmbeddingAnimationBackground): SplitAttributes.Builder

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

The default is EmbeddingAnimationBackground.DEFAULT, which means to use the current theme window background color.

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

Parameters
background: EmbeddingAnimationBackground

The animation background.

Returns
SplitAttributes.Builder

This Builder.

setDividerAttributes

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

Sets the DividerAttributes.

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.