diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-05-17 16:12:37 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-20 12:00:17 -0700 |
commit | c79bd214719f73c55da5e3ecc744f58dd97f5156 (patch) | |
tree | 5d14ea47186ed537125c4829ab6300d9b7727a39 /quickstep | |
parent | 7c278b62f97d6218d3647c13d0216c9a67deb2ba (diff) | |
download | android_packages_apps_Trebuchet-c79bd214719f73c55da5e3ecc744f58dd97f5156.tar.gz android_packages_apps_Trebuchet-c79bd214719f73c55da5e3ecc744f58dd97f5156.tar.bz2 android_packages_apps_Trebuchet-c79bd214719f73c55da5e3ecc744f58dd97f5156.zip |
Fixing inset map in case of display cutouts
Change-Id: Ia2969688d9ae4c89a2da45eb6361f4476e1877ec
Diffstat (limited to 'quickstep')
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java index ebae1cd96..336cdc93f 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java @@ -76,8 +76,13 @@ public abstract class RecentsUiFactory { @Override public void mapInsets(Context context, Rect insets, Rect out) { + // If there is a display cutout, the top insets in portrait would also include the + // cutout, which we will get as the left inset in landscape. Using the max of left and + // top allows us to cover both cases (with or without cutout). if (SysUINavigationMode.getMode(context) == NO_BUTTON) { - out.set(insets); + out.top = Math.max(insets.top, insets.left); + out.bottom = Math.max(insets.right, insets.bottom); + out.left = out.right = 0; } else { out.top = Math.max(insets.top, insets.left); out.bottom = insets.right; @@ -99,7 +104,9 @@ public abstract class RecentsUiFactory { @Override public void mapInsets(Context context, Rect insets, Rect out) { if (SysUINavigationMode.getMode(context) == NO_BUTTON) { - out.set(insets); + out.top = Math.max(insets.top, insets.right); + out.bottom = Math.max(insets.left, insets.bottom); + out.left = out.right = 0; } else { out.top = Math.max(insets.top, insets.right); out.bottom = insets.left; |