WindowMetrics
public final class WindowMetrics
Metrics about a android.view.Window, consisting of its bounds.
This is obtained from WindowMetricsCalculator.computeCurrentWindowMetrics or WindowMetricsCalculator.computeMaximumWindowMetrics.
| See also | |
|---|---|
WindowMetricsCalculator |
Summary
Public methods |
|
|---|---|
boolean |
|
final @NonNull Rect |
Returns a new |
final float |
Returns the logical density of the display this window is in. |
final float |
Returns the height of the |
final float |
Returns the width of the |
int |
hashCode() |
@NonNull String |
toString() |
Public methods
getBounds
public final @NonNull Rect getBounds()
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 android.view.Display.getSize. This method reports the window size including insets from all system decorations, while android.view.Display.getSize reports the area excluding navigation bars and display cutout areas.
getDensity
public final float getDensity()
Returns the logical density of the display this window is in.
| See also | |
|---|---|
density |
getHeightDp
public final float getHeightDp()
Returns the height of the Rect in DP units including insets from all system decorations.
getWidthDp
public final float getWidthDp()
Returns the width of the Rect in DP units including insets from all system decorations.