EmbeddingAspectRatio


public final class EmbeddingAspectRatio


The aspect ratio of the parent window bound to allow embedding with the rule.

Summary

Public fields

static final @NonNull EmbeddingAspectRatio

Gets the special EmbeddingAspectRatio to represent it always allows embedding.

static final @NonNull EmbeddingAspectRatio

Gets the special EmbeddingAspectRatio to represent it always disallows embedding.

Public methods

boolean
equals(Object other)
int
static final @NonNull EmbeddingAspectRatio
ratio(@FloatRange(from = 1.0, fromInclusive = false) float ratio)

For max aspect ratio, when the aspect ratio is greater than this value, it means to disallow embedding.

@NonNull String

Public fields

ALWAYS_ALLOW

public static final @NonNull EmbeddingAspectRatio ALWAYS_ALLOW

Gets the special EmbeddingAspectRatio to represent it always allows embedding.

An example use case is to set it on SplitRule.maxAspectRatioInLandscape if the app wants to always allow embedding as split when the parent window is in landscape.

ALWAYS_DISALLOW

public static final @NonNull EmbeddingAspectRatio ALWAYS_DISALLOW

Gets the special EmbeddingAspectRatio to represent it always disallows embedding.

An example use case is to set it on SplitRule.maxAspectRatioInPortrait if the app wants to disallow embedding as split when the parent window is in portrait.

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

ratio

Added in 1.1.0
public static final @NonNull EmbeddingAspectRatio ratio(@FloatRange(from = 1.0, fromInclusive = false) float ratio)

For max aspect ratio, when the aspect ratio is greater than this value, it means to disallow embedding.

For min aspect ratio, when the aspect ratio is smaller than this value, it means to disallow embedding.

Values smaller than or equal to 1 are invalid.

Parameters
@FloatRange(from = 1.0, fromInclusive = false) float ratio

the aspect ratio.

Returns
@NonNull EmbeddingAspectRatio

the EmbeddingAspectRatio representing the ratio.

See also
ALWAYS_ALLOW

for always allow embedding.

ALWAYS_DISALLOW

for always disallow embedding.

toString

public @NonNull String toString()