From 5c907cb5ca63956371984623d0996bdbb52707ec Mon Sep 17 00:00:00 2001 From: joneckenrode Date: Mon, 28 Mar 2022 19:19:18 +0000 Subject: Updated API documentation of screenWidthDp and screenHeightDp. Bug: 170805355 Test: Built API docs Signed-off-by: joneckenrode Change-Id: I8ae77784e07c9f9a552da2f3b1d290fac65e0765 --- core/java/android/content/res/Configuration.java | 45 +++++++++++++++++++----- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 755114e0ac67..bd6fcd8a61e4 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -751,11 +751,25 @@ public final class Configuration implements Parcelable, Comparablescreen - * width resource qualifier. Set to + * The current width of the available screen space in dp units, excluding + * the area occupied by screen decorations at the edges of the display. + * Corresponds to the + * + * available width resource qualifier. Defaults to * {@link #SCREEN_WIDTH_DP_UNDEFINED} if no width is specified. + * + *

In multi-window mode, equals the width of the available display area + * of the app window, not the available display area of the device screen + * (for example, when apps are displayed side by side in split-screen mode + * in landscape orientation). + * + *

Differs from {@link android.view.WindowMetrics} by not including + * screen decorations in the width measurement and by expressing the + * measurement in dp rather than px. Use {@code screenWidthDp} to obtain the + * horizontal display area available to the app, excluding the area occupied + * by screen decorations. Use {@link android.view.WindowMetrics#getBounds()} + * to obtain the width of the display area available to the app, including + * the area occupied by screen decorations. */ public int screenWidthDp; @@ -766,11 +780,26 @@ public final class Configuration implements Parcelable, Comparablescreen - * height resource qualifier. Set to + * The current height of the available screen space in dp units, excluding + * the area occupied by screen decorations at the edges of the display (such + * as the status bar, navigation bar, and cutouts). Corresponds to the + * + * available height resource qualifier. Defaults to * {@link #SCREEN_HEIGHT_DP_UNDEFINED} if no height is specified. + * + *

In multi-window mode, equals the height of the available display area + * of the app window, not the available display area of the device screen + * (for example, when apps are displayed one above another in split-screen + * mode in portrait orientation). + * + *

Differs from {@link android.view.WindowMetrics} by not including + * screen decorations in the height measurement and by expressing the + * measurement in dp rather than px. Use {@code screenHeightDp} to obtain + * the vertical display area available to the app, excluding the area + * occupied by screen decorations. Use + * {@link android.view.WindowMetrics#getBounds()} to obtain the height of + * the display area available to the app, including the area occupied by + * screen decorations. */ public int screenHeightDp; -- cgit v1.2.3-59-g8ed1b