From 2ff1e12e1ff9952fe489c9023eb76d342af1ddbf Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sat, 19 Mar 2022 09:22:24 +0000 Subject: [PATCH 06/43] UI: Adjust split-screen divider - Kill rounded corners - where two rectangles collide should be perfectly straight - Make it black (pre-Sv2) for phones - Follow taskbar theme for tablets Change-Id: I240b627793b615c82bd07ebd77638cde180ef80f --- .../color-night-v31/taskbar_background.xml | 20 +++++++++++++++++ .../taskbar_nav_icon_color.xml | 18 +++++++++++++++ .../res/color-v31/taskbar_background.xml | 18 +++++++++++++++ .../res/color-v31/taskbar_nav_icon_color.xml | 18 +++++++++++++++ .../Shell/res/values-sw600dp/colors.xml | 22 +++++++++++++++++++ .../WindowManager/Shell/res/values/colors.xml | 2 +- .../wm/shell/common/split/SplitLayout.java | 19 ++-------------- 7 files changed, 99 insertions(+), 18 deletions(-) create mode 100644 libs/WindowManager/Shell/res/color-night-v31/taskbar_background.xml create mode 100644 libs/WindowManager/Shell/res/color-night-v31/taskbar_nav_icon_color.xml create mode 100644 libs/WindowManager/Shell/res/color-v31/taskbar_background.xml create mode 100644 libs/WindowManager/Shell/res/color-v31/taskbar_nav_icon_color.xml create mode 100644 libs/WindowManager/Shell/res/values-sw600dp/colors.xml diff --git a/libs/WindowManager/Shell/res/color-night-v31/taskbar_background.xml b/libs/WindowManager/Shell/res/color-night-v31/taskbar_background.xml new file mode 100644 index 000000000000..ec7a6823d34d --- /dev/null +++ b/libs/WindowManager/Shell/res/color-night-v31/taskbar_background.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/libs/WindowManager/Shell/res/color-night-v31/taskbar_nav_icon_color.xml b/libs/WindowManager/Shell/res/color-night-v31/taskbar_nav_icon_color.xml new file mode 100644 index 000000000000..cc8e3b30b1b5 --- /dev/null +++ b/libs/WindowManager/Shell/res/color-night-v31/taskbar_nav_icon_color.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/libs/WindowManager/Shell/res/color-v31/taskbar_background.xml b/libs/WindowManager/Shell/res/color-v31/taskbar_background.xml new file mode 100644 index 000000000000..5c53e4a0c9c6 --- /dev/null +++ b/libs/WindowManager/Shell/res/color-v31/taskbar_background.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/libs/WindowManager/Shell/res/color-v31/taskbar_nav_icon_color.xml b/libs/WindowManager/Shell/res/color-v31/taskbar_nav_icon_color.xml new file mode 100644 index 000000000000..7951e123afc4 --- /dev/null +++ b/libs/WindowManager/Shell/res/color-v31/taskbar_nav_icon_color.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/libs/WindowManager/Shell/res/values-sw600dp/colors.xml b/libs/WindowManager/Shell/res/values-sw600dp/colors.xml new file mode 100644 index 000000000000..8a1907da76e5 --- /dev/null +++ b/libs/WindowManager/Shell/res/values-sw600dp/colors.xml @@ -0,0 +1,22 @@ + + + + @color/taskbar_nav_icon_color + @color/taskbar_background + diff --git a/libs/WindowManager/Shell/res/values/colors.xml b/libs/WindowManager/Shell/res/values/colors.xml index 758dbfd5f3c5..e82f6ff9a4db 100644 --- a/libs/WindowManager/Shell/res/values/colors.xml +++ b/libs/WindowManager/Shell/res/values/colors.xml @@ -18,7 +18,7 @@ --> #ffffff - @color/taskbar_background_dark + @android:color/black #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 6b2d544c192a..7c4db20d8cd8 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 @@ -168,23 +168,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange } private void updateDividerConfig(Context context) { - final Resources resources = context.getResources(); - final Display display = context.getDisplay(); - final int dividerInset = resources.getDimensionPixelSize( - com.android.internal.R.dimen.docked_stack_divider_insets); - int radius = 0; - RoundedCorner corner = display.getRoundedCorner(RoundedCorner.POSITION_TOP_LEFT); - radius = corner != null ? Math.max(radius, corner.getRadius()) : radius; - corner = display.getRoundedCorner(RoundedCorner.POSITION_TOP_RIGHT); - radius = corner != null ? Math.max(radius, corner.getRadius()) : radius; - corner = display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_RIGHT); - radius = corner != null ? Math.max(radius, corner.getRadius()) : radius; - corner = display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT); - radius = corner != null ? Math.max(radius, corner.getRadius()) : radius; - - mDividerInsets = Math.max(dividerInset, radius); - mDividerSize = resources.getDimensionPixelSize(R.dimen.split_divider_bar_width); - mDividerWindowWidth = mDividerSize + 2 * mDividerInsets; + mDividerWindowWidth = context.getResources().getDimensionPixelSize( + R.dimen.split_divider_bar_width); } /** Gets bounds of the primary split with screen based coordinate. */ -- 2.34.1