WindowMetrics

public final class WindowMetrics


Metrics about a android.view.Window, consisting of its bounds.

This is obtained from WindowMetricsCalculator.computeCurrentWindowMetrics or WindowMetricsCalculator.computeMaximumWindowMetrics.

Summary

Public fields

final @NonNull Rect

Returns a new Rect describing the bounds of the area the window occupies.

Public methods

boolean
equals(Object other)
int
@NonNull String

Public fields

bounds

public final @NonNull Rect bounds

Returns a new Rect describing the bounds of the area the window occupies.

Note that the size of the reported bounds can have different size than Display#getSize. This method reports the window size including all system decorations, while Display#getSize reports the area excluding navigation bars and display cutout areas.

Returns
@NonNull Rect

window bounds in pixels.

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

toString

public @NonNull String toString()