From b051354de510273c291b4148088aecff69ffc723 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Fri, 18 Jun 2021 14:19:01 -0400 Subject: [PATCH] Re-add dividers when expanding notifications. * This makes the divider consistent, given Ic181bc8b23ae62c8212fee19fd7c6434eb94cd61 * Fixes some small color/alpha changing bugs that occurred when the expansion finished and the background and dividers disappear. * If we want to disable the dividers, we can do so quickly by setting `notification_children_container_divider_height` to 0 Bug: 191187506 Test: expand and collapse groups a bunch. Change-Id: I773ef25ec7e0121603412aff3418843a7aa4d7aa --- packages/SystemUI/res/values-night/colors.xml | 4 ++-- packages/SystemUI/res/values/colors.xml | 2 +- packages/SystemUI/res/values/dimens.xml | 2 +- .../notification/stack/NotificationChildrenContainer.java | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml index 8e6293aa2e04a..b98694e2fae73 100644 --- a/packages/SystemUI/res/values-night/colors.xml +++ b/packages/SystemUI/res/values-night/colors.xml @@ -21,8 +21,8 @@ It's fine to override this color since at that point the shade was dark. --> @color/GM2_grey_900 - - #212121 + + @*android:color/background_device_default_dark @color/GM2_grey_500 diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 2cf30581326bd..e7edb0e6a57da 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -93,7 +93,7 @@ #ff333333 - #FF616161 + @*android:color/background_device_default_light #28000000 diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 9b860c75f476c..3e4684c9b2d62 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -685,7 +685,7 @@ 0dp - 0.5 + 1 diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java index 99fe541d01353..2ec782cf64bcc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java @@ -725,7 +725,7 @@ public class NotificationChildrenContainer extends ViewGroup { tmpState.yTranslation = viewState.yTranslation - mDividerHeight; float alpha = mChildrenExpanded && viewState.alpha != 0 ? mDividerAlpha : 0; if (mUserLocked && !showingAsLowPriority() && viewState.alpha != 0) { - alpha = NotificationUtils.interpolate(0, 0.5f, + alpha = NotificationUtils.interpolate(0, mDividerAlpha, Math.min(viewState.alpha, expandFraction)); } tmpState.hidden = !dividersVisible; @@ -802,9 +802,9 @@ public class NotificationChildrenContainer extends ViewGroup { View divider = mDividers.get(i); tmpState.initFrom(divider); tmpState.yTranslation = viewState.yTranslation - mDividerHeight; - float alpha = mChildrenExpanded && viewState.alpha != 0 ? 0.5f : 0; + float alpha = mChildrenExpanded && viewState.alpha != 0 ? mDividerAlpha : 0; if (mUserLocked && !showingAsLowPriority() && viewState.alpha != 0) { - alpha = NotificationUtils.interpolate(0, 0.5f, + alpha = NotificationUtils.interpolate(0, mDividerAlpha, Math.min(viewState.alpha, expandFraction)); } tmpState.hidden = !dividersVisible;