SplitAttributes.Builder


public final 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 methods

final @NonNull SplitAttributes

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

final @NonNull SplitAttributes.Builder

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

final @NonNull SplitAttributes.Builder

Sets the DividerAttributes for this split.

final @NonNull SplitAttributes.Builder

Sets the split layout direction attribute.

final @NonNull SplitAttributes.Builder

Sets the split type attribute.

Public constructors

Builder

Added in 1.1.0
public Builder()

Public methods

build

Added in 1.1.0
public final @NonNull SplitAttributes build()

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

Returns
@NonNull SplitAttributes

The new SplitAttributes instance.

setAnimationParams

Added in 1.4.0-beta01
@RequiresWindowSdkExtension(version = 5)
public final @NonNull SplitAttributes.Builder setAnimationParams(@NonNull EmbeddingAnimationParams params)

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
@NonNull EmbeddingAnimationParams params

The animation params.

Returns
@NonNull SplitAttributes.Builder

This Builder.

setDividerAttributes

Added in 1.4.0-beta01
@RequiresWindowSdkExtension(version = 6)
public final @NonNull SplitAttributes.Builder setDividerAttributes(@NonNull DividerAttributes dividerAttributes)

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
@NonNull DividerAttributes dividerAttributes

The divider attributes.

Returns
@NonNull SplitAttributes.Builder

This Builder.

setLayoutDirection

Added in 1.1.0
public final @NonNull SplitAttributes.Builder setLayoutDirection(
    @NonNull SplitAttributes.LayoutDirection layoutDirection
)

Sets the split layout direction attribute.

The default is based on locale.

Parameters
@NonNull SplitAttributes.LayoutDirection layoutDirection

The layout direction attribute.

Returns
@NonNull SplitAttributes.Builder

This Builder.

setSplitType

Added in 1.1.0
public final @NonNull SplitAttributes.Builder setSplitType(@NonNull SplitAttributes.SplitType type)

Sets the split type attribute.

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

Parameters
@NonNull SplitAttributes.SplitType type

The split type attribute.

Returns
@NonNull SplitAttributes.Builder

This Builder.