WindowMetrics

public final class WindowMetrics


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

This is usually obtained from WindowInfoRepository.currentWindowMetrics or WindowMetricsCalculator.computeMaximumWindowMetrics.

Summary

Public fields

final @NonNull Rect

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

Public constructors

Public methods

boolean
int

Public fields

bounds

@NonNull
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 constructors

WindowMetrics

public final WindowMetrics(@NonNull Rect bounds)

Public methods

equals

@NonNull
public boolean equals(@Nullable Object other)

hashCode

@NonNull
public int hashCode()