summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jon Eckenrode <joneckenrode@google.com> 2022-04-04 18:00:57 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-04-04 18:00:57 +0000
commitd697c8b46d9907f665313ef725f8f49e55da7d39 (patch)
tree53c8f9c558624b6be08bfe0d8aa8264b5baaf8c6
parent16aa1bcc9fb7e1f312ceb3fdc1a908676741af33 (diff)
parentec2121901c862610fc34483f0a4c44ca597240ba (diff)
Merge "Updated API documentation of screenWidthDp and screenHeightDp." am: ec2121901c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2030783 Change-Id: I607d3723b0d2855f9b53f30cd4dda058ff3b4d93 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--core/java/android/content/res/Configuration.java45
1 files 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, Comparable<Configuration
public static final int SCREEN_WIDTH_DP_UNDEFINED = 0;
/**
- * The current width of the available screen space, in dp units,
- * corresponding to
- * <a href="{@docRoot}guide/topics/resources/providing-resources.html#ScreenWidthQualifier">screen
- * width</a> 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
+ * <a href="{@docRoot}guide/topics/resources/providing-resources.html#AvailableWidthHeightQualifier">
+ * available width</a> resource qualifier. Defaults to
* {@link #SCREEN_WIDTH_DP_UNDEFINED} if no width is specified.
+ *
+ * <p>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).
+ *
+ * <p>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, Comparable<Configuration
public static final int SCREEN_HEIGHT_DP_UNDEFINED = 0;
/**
- * The current height of the available screen space, in dp units,
- * corresponding to
- * <a href="{@docRoot}guide/topics/resources/providing-resources.html#ScreenHeightQualifier">screen
- * height</a> 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
+ * <a href="{@docRoot}guide/topics/resources/providing-resources.html#AvailableWidthHeightQualifier">
+ * available height</a> resource qualifier. Defaults to
* {@link #SCREEN_HEIGHT_DP_UNDEFINED} if no height is specified.
+ *
+ * <p>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).
+ *
+ * <p>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;