WindowMetricsTesting

Added in 1.4.0-beta01

public final class WindowMetricsTesting


Summary

Public methods

static final @NonNull WindowMetrics
createWindowMetrics(@NonNull Rect bounds, float density)

Returns a WindowMetrics with default values for testing.

static final @NonNull WindowMetrics
createWindowMetrics(
    int left,
    int top,
    int right,
    int bottom,
    float density
)

Returns a WindowMetrics with default values for testing.

Public methods

createWindowMetrics

public static final @NonNull WindowMetrics createWindowMetrics(@NonNull Rect bounds, float density)

Returns a WindowMetrics with default values for testing.

Parameters
@NonNull Rect bounds

The window bounds This value cannot be null.

float density

The window density.

createWindowMetrics

public static final @NonNull WindowMetrics createWindowMetrics(
    int left,
    int top,
    int right,
    int bottom,
    float density
)

Returns a WindowMetrics with default values for testing.

Parameters
int left

The X coordinate of the left side of window bounds.

int top

The Y coordinate of the top side of window bounds.

int right

The X coordinate of the right side of window bounds.

int bottom

The Y coordinate of the bottom side of window bounds.

float density

The window density.