SplitAttributes
public final class SplitAttributes
Attributes that describe how the parent window (typically the activity task window) is split between the primary and secondary activity containers, including:
-
Split type — Categorizes the split and specifies the sizes of the primary and secondary activity containers relative to the parent bounds
-
Layout direction — Specifies whether the parent window is split vertically or horizontally and in which direction the primary and secondary containers are respectively positioned (left to right, right to left, top to bottom, and so forth)
-
Animation params — The parameters for the animation of the split involving this
SplitAttributesobject -
Divider attributes — Specifies whether a divider is needed between the split containers and the properties of the divider, including the color, the width, whether the divider is draggable, etc.
Attributes can be configured by:
-
Setting the default
SplitAttributesusingSplitPairRule.Builder.setDefaultSplitAttributesorSplitPlaceholderRule.Builder.setDefaultSplitAttributes. -
Setting
splitRatio,splitLayoutDirection, andanimationParamsattributes in<SplitPairRule>or<SplitPlaceholderRule>tags in an XML configuration file. The attributes are parsed asSplitType,LayoutDirection, andEmbeddingAnimationParams, respectively. Note thatSplitType.SPLIT_TYPE_HINGEis not supported XML format. -
Using
SplitController.setSplitAttributesCalculatorto customize theSplitAttributesfor a given device and window state.
| See also | |
|---|---|
SplitAttributes.Builder |
|
SplitAttributes.SplitType |
|
SplitAttributes.LayoutDirection |
|
EmbeddingAnimationParams |
Summary
Nested types |
|---|
public final class SplitAttributes.BuilderBuilder for creating an instance of |
public final class SplitAttributes.LayoutDirectionThe layout direction of the primary and secondary activity containers. |
public final class SplitAttributes.SplitTypeThe type of parent window split, which defines the proportion of the parent window occupied by the primary and secondary activity containers. |
Public methods |
|
|---|---|
boolean |
Determines whether this object has the same split attributes as the compared object. |
final @NonNull EmbeddingAnimationParams |
The animation params to specify the animation transitions of the split involving this |
final @NonNull DividerAttributes |
The |
final @NonNull SplitAttributes.LayoutDirection |
The layout direction of the parent window split. |
final @NonNull SplitAttributes.SplitType |
The split type attribute. |
int |
hashCode()Returns a hash code for this |
@NonNull String |
toString()A string representation of this |
Public methods
equals
public boolean equals(Object other)
Determines whether this object has the same split attributes as the compared object.
| Parameters | |
|---|---|
Object other |
The object to compare to this object. |
| Returns | |
|---|---|
boolean |
True if the objects have the same split attributes, false otherwise. |
getAnimationParams
public final @NonNull EmbeddingAnimationParams getAnimationParams()
The animation params to specify the animation transitions of the split involving this SplitAttributes object. The default is to use the current theme window background color and system transitions.
getDividerAttributes
public final @NonNull DividerAttributes getDividerAttributes()
The DividerAttributes for this split. Defaults to DividerAttributes.NO_DIVIDER, which means no divider is requested.
getLayoutDirection
public final @NonNull SplitAttributes.LayoutDirection getLayoutDirection()
The layout direction of the parent window split. The default is based on locale value.
getSplitType
public final @NonNull SplitAttributes.SplitType getSplitType()
The split type attribute. Defaults to an equal split of the parent window for the primary and secondary containers.
hashCode
public int hashCode()
Returns a hash code for this SplitAttributes object.
| Returns | |
|---|---|
int |
The hash code for this object. |