From 3121768f796e9dfc7f040877c29222d7977b6127 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Fri, 24 Feb 2023 23:45:19 +0000 Subject: [PATCH] Update split screen UI to support light theme. Persistent Taskbar supports light/dark themeing, so split screen should blend with the current mode. Test: Manual Fix: 268052229 Change-Id: I4a2857c89a04bdacb35c2189b82b8396cbf712ee Merged-In: I4a2857c89a04bdacb35c2189b82b8396cbf712ee --- .../taskbar_background.xml} | 3 ++- libs/WindowManager/Shell/res/color/taskbar_background.xml | 2 +- libs/WindowManager/Shell/res/values-night/colors.xml | 1 + libs/WindowManager/Shell/res/values/colors.xml | 3 ++- .../src/com/android/wm/shell/common/split/SplitLayout.java | 4 ++++ 5 files changed, 10 insertions(+), 3 deletions(-) rename libs/WindowManager/Shell/res/{color/split_divider_background.xml => color-night/taskbar_background.xml} (82%) diff --git a/libs/WindowManager/Shell/res/color/split_divider_background.xml b/libs/WindowManager/Shell/res/color-night/taskbar_background.xml similarity index 82% rename from libs/WindowManager/Shell/res/color/split_divider_background.xml rename to libs/WindowManager/Shell/res/color-night/taskbar_background.xml index 049980803ee3d..9473cdd607d69 100644 --- a/libs/WindowManager/Shell/res/color/split_divider_background.xml +++ b/libs/WindowManager/Shell/res/color-night/taskbar_background.xml @@ -1,6 +1,6 @@ + \ No newline at end of file diff --git a/libs/WindowManager/Shell/res/color/taskbar_background.xml b/libs/WindowManager/Shell/res/color/taskbar_background.xml index b3d2602991062..0e165fca4fd38 100644 --- a/libs/WindowManager/Shell/res/color/taskbar_background.xml +++ b/libs/WindowManager/Shell/res/color/taskbar_background.xml @@ -16,5 +16,5 @@ --> - + \ No newline at end of file diff --git a/libs/WindowManager/Shell/res/values-night/colors.xml b/libs/WindowManager/Shell/res/values-night/colors.xml index 83c4d93982f4e..5c6bb57a7f1cf 100644 --- a/libs/WindowManager/Shell/res/values-night/colors.xml +++ b/libs/WindowManager/Shell/res/values-night/colors.xml @@ -15,6 +15,7 @@ --> + #ffffff @color/GM2_grey_200 diff --git a/libs/WindowManager/Shell/res/values/colors.xml b/libs/WindowManager/Shell/res/values/colors.xml index 6e750a3d5e34c..85fbdea118078 100644 --- a/libs/WindowManager/Shell/res/values/colors.xml +++ b/libs/WindowManager/Shell/res/values/colors.xml @@ -17,7 +17,8 @@ */ --> - #ffffff + #000000 + @color/taskbar_background #59000000 #60000000 #00000000 diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java index f616e6f64750a..ffc56b6f6106d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java @@ -120,6 +120,7 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange private int mOrientation; private int mRotation; private int mDensity; + private int mUiMode; private final boolean mDimNonImeSide; private ValueAnimator mDividerFlingAnimator; @@ -295,10 +296,12 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange final Rect rootBounds = configuration.windowConfiguration.getBounds(); final int orientation = configuration.orientation; final int density = configuration.densityDpi; + final int uiMode = configuration.uiMode; if (mOrientation == orientation && mRotation == rotation && mDensity == density + && mUiMode == uiMode && mRootBounds.equals(rootBounds)) { return false; } @@ -310,6 +313,7 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange mRootBounds.set(rootBounds); mRotation = rotation; mDensity = density; + mUiMode = uiMode; mDividerSnapAlgorithm = getSnapAlgorithm(mContext, mRootBounds, null); updateDividerConfig(mContext); initDividerPosition(mTempRect);