SplitPlaceholderRule


class SplitPlaceholderRule : 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

Builder for SplitPlaceholderRule.

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Set<ActivityFilter>

Filters used to choose when to apply this rule.

SplitRule.FinishBehavior

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

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.

Intent

Intent to launch the placeholder activity.

Inherited properties

From androidx.window.embedding.EmbeddingRule
String?

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

From androidx.window.embedding.SplitRule
SplitAttributes

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

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.

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.

Int

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

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.

Int

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

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

filters

Added in 1.0.0
val filtersSet<ActivityFilter>

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

finishPrimaryWithPlaceholder

Added in 1.1.0
val finishPrimaryWithPlaceholderSplitRule.FinishBehavior

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

isSticky

Added in 1.1.0
val isStickyBoolean

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

placeholderIntent

Added in 1.0.0
val placeholderIntentIntent

Intent to launch the placeholder activity.