SplitPairRule


public final class SplitPairRule extends SplitRule


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 RuleController.setRules or RuleController.addRule. 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

public final class SplitPairRule.Builder

Builder for SplitPairRule.

Public methods

boolean
equals(Object other)
final 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.

final @NonNull Set<@NonNull SplitPairFilter>

Filters used to choose when to apply this rule.

final @NonNull SplitRule.FinishBehavior

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

final @NonNull SplitRule.FinishBehavior

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

int
@NonNull String

Inherited methods

From androidx.window.embedding.EmbeddingRule
final String

A unique string to identify this EmbeddingRule, which defaults to null.

From androidx.window.embedding.SplitRule
final @NonNull SplitAttributes

The default SplitAttributes to apply on the activity containers pair when the host task bounds satisfy minWidthDp, minHeightDp, minSmallestWidthDp, maxAspectRatioInPortrait and maxAspectRatioInLandscape requirements.

final @NonNull EmbeddingAspectRatio

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.

final @NonNull EmbeddingAspectRatio

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.

final int

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

final int

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

final int

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

Public methods

equals

public boolean equals(Object other)

getClearTop

Added in 1.0.0
public final boolean getClearTop()

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.

getFilters

Added in 1.0.0
public final @NonNull Set<@NonNull SplitPairFiltergetFilters()

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

getFinishPrimaryWithSecondary

Added in 1.0.0
public final @NonNull SplitRule.FinishBehavior getFinishPrimaryWithSecondary()

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

See also
NEVER
ALWAYS
ADJACENT

getFinishSecondaryWithPrimary

Added in 1.0.0
public final @NonNull SplitRule.FinishBehavior getFinishSecondaryWithPrimary()

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

See also
NEVER
ALWAYS
ADJACENT

hashCode

public int hashCode()

toString

public @NonNull String toString()