DisplayFeatureTesting
public final class DisplayFeatureTesting
Summary
Public methods |
|
|---|---|
static final @NonNull FoldingFeature |
createFoldingFeature(A convenience method to get a test fold with default values provided. |
static final @NonNull FoldingFeature |
createFoldingFeature(A convenience method to get a test |
Public methods
createFoldingFeature
public static final @NonNull FoldingFeature createFoldingFeature(
@NonNull Activity activity,
@IntRange(from = -1) int center,
int size,
@NonNull FoldingFeature.State state,
@NonNull FoldingFeature.Orientation orientation
)
A convenience method to get a test fold with default values provided. With the default values it returns a FoldingFeature.State.HALF_OPENED feature that splits the screen along the FoldingFeature.Orientation.HORIZONTAL axis.
The bounds of the feature are calculated based on orientation and size. If the feature is VERTICAL then the feature is centered horizontally. The top-left x-coordinate is center - (size / 2) and the top-right x-coordinate is center + (size / 2). If the feature is HORIZONTAL then the feature is centered vertically. The top-left y-coordinate is center - (size / 2) and the bottom-left y-coordinate is center - (size / 2). The folding features always cover the window in one dimension and that determines the other coordinates.
Use FOLDING_FEATURE_CENTER_DEFAULT to default to the center of Activity window bounds. Otherwise, use values greater than or equal to 0 to specify the center.
| Parameters | |
|---|---|
@NonNull Activity activity |
that will house the |
@IntRange(from = -1) int center |
the center of the fold complementary to the orientation in px. For a |
int size |
the smaller dimension of the fold in px. The larger dimension always covers the entire window. |
@NonNull FoldingFeature.State state |
|
@NonNull FoldingFeature.Orientation orientation |
|
| Returns | |
|---|---|
@NonNull FoldingFeature |
|
createFoldingFeature
public static final @NonNull FoldingFeature createFoldingFeature(
@NonNull Rect windowBounds,
@IntRange(from = -1) int center,
int size,
@NonNull FoldingFeature.State state,
@NonNull FoldingFeature.Orientation orientation
)
A convenience method to get a test FoldingFeature with default values provided. With the default values it returns a FoldingFeature.State.HALF_OPENED feature that splits the screen along the FoldingFeature.Orientation.HORIZONTAL axis.
The bounds of the feature are calculated based on orientation and size. If the feature is VERTICAL then the feature is centered horizontally. The top-left x-coordinate is center - (size / 2) and the top-right x-coordinate is center + (size / 2). If the feature is HORIZONTAL then the feature is centered vertically. The top-left y-coordinate is center - (size / 2) and the bottom-left y-coordinate is center - (size / 2). The folding features always cover the window in one dimension and that determines the other coordinates.
Use FOLDING_FEATURE_CENTER_DEFAULT to default to the center of Activity window bounds. Otherwise, use values greater than or equal to 0 to specify the center.
| Parameters | |
|---|---|
@NonNull Rect windowBounds |
that will contain the |
@IntRange(from = -1) int center |
the center of the fold complementary to the orientation in px. For a |
int size |
the smaller dimension of the fold in px. The larger dimension always covers the entire window. |
@NonNull FoldingFeature.State state |
|
@NonNull FoldingFeature.Orientation orientation |
|
| Returns | |
|---|---|
@NonNull FoldingFeature |
|