SplitPlaceholderRule

public final class SplitPlaceholderRule extends SplitRule


Configuration rules for split placeholders.

A placeholder activity is usually a mostly empty activity that temporarily occupies the secondary container of a split. The placeholder is intended to be replaced when another activity with content is launched in a dedicated SplitPairRule. The placeholder activity is then occluded by the newly launched activity. The placeholder can provide some optional features but must not host important UI elements exclusively, since the placeholder is not shown on some devices and screen configurations, such as devices with small screens.

Configuration rules can be added using RuleController.addRule or RuleController.setRules.

See Activity embedding for more information.

Summary

Nested types

public final class SplitPlaceholderRule.Builder

Builder for SplitPlaceholderRule.

Public methods

boolean
equals(Object other)
final @NonNull Set<@NonNull ActivityFilter>

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 placeholder container.

final @NonNull Intent

Intent to launch the placeholder activity.

int
final boolean

Determines whether the placeholder will show on top in a smaller window size after it first appeared in a split with sufficient minimum width.

@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)

getFilters

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

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

getFinishPrimaryWithPlaceholder

Added in 1.1.0
public final @NonNull SplitRule.FinishBehavior getFinishPrimaryWithPlaceholder()

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

Note that it is not valid to set SplitRule.FinishBehavior.NEVER

See also
ALWAYS
ADJACENT

getPlaceholderIntent

Added in 1.0.0
public final @NonNull Intent getPlaceholderIntent()

Intent to launch the placeholder activity.

hashCode

public int hashCode()

isSticky

Added in 1.1.0
public final boolean isSticky()

Determines whether the placeholder will show on top in a smaller window size after it first appeared in a split with sufficient minimum width.

toString

public @NonNull String toString()