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 |
static final @NonNull EmbeddingAspectRatio |
Gets the special |
Public methods |
|
|---|---|
boolean |
|
int |
hashCode() |
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 |
toString() |
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
ratio
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 |
| See also | |
|---|---|
ALWAYS_ALLOW |
for always allow embedding. |
ALWAYS_DISALLOW |
for always disallow embedding. |