From e6cec1a2e4c83cebb919b384147dae2e77f263cd Mon Sep 17 00:00:00 2001 From: joneckenrode Date: Wed, 20 Apr 2022 00:18:10 +0000 Subject: [PATCH] Updated API documentation of screenWidthDp and screenHeightDp to include multiple-screen behavior. Test: Built API docs Signed-off-by: joneckenrode Change-Id: I44aec14f1607e3ddabb7f792eac22da982347613 --- core/java/android/content/res/Configuration.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index dd3ddafd4a098..29f21f14088e6 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -763,6 +763,14 @@ public final class Configuration implements Parcelable, ComparableIn multiple-screen scenarios, the width measurement can span screens. + * For example, if the app is spanning both screens of a dual-screen device + * (with the screens side by side), {@code screenWidthDp} represents the + * width of both screens, excluding the area occupied by screen decorations. + * When the app is restricted to a single screen in a multiple-screen + * environment, {@code screenWidthDp} is the width of the screen on which + * the app is running. + * *

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 @@ -792,6 +800,14 @@ public final class Configuration implements Parcelable, ComparableIn multiple-screen scenarios, the height measurement can span screens. + * For example, if the app is spanning both screens of a dual-screen device + * rotated 90 degrees (one screen above the other), {@code screenHeightDp} + * represents the height of both screens, excluding the area occupied by + * screen decorations. When the app is restricted to a single screen in a + * multiple-screen environment, {@code screenHeightDp} is the height of the + * screen on which the app is running. + * *

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