SplitPlaceholderRule
public final class SplitPlaceholderRule extends SplitRule
| java.lang.Object | |||
| ↳ | androidx.window.embedding.EmbeddingRule | ||
| ↳ | androidx.window.embedding.SplitRule | ||
| ↳ | androidx.window.embedding.SplitPlaceholderRule |
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.BuilderBuilder for |
Public methods |
|
|---|---|
boolean |
|
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 |
hashCode() |
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. |
@NonNull String |
toString() |
Inherited methods |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||
|
Public methods
getFilters
public final @NonNull Set<@NonNull ActivityFilter> getFilters()
Filters used to choose when to apply this rule. The rule may be used if any one of the provided filters matches.
getFinishPrimaryWithPlaceholder
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
getPlaceholderIntent
public final @NonNull Intent getPlaceholderIntent()
Intent to launch the placeholder activity.