Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92e203c1 authored by Andreas Miko's avatar Andreas Miko
Browse files

Fix bundle header background during expansion

This CL tackles two bugs:
1) The backgrounds of groups within bundles and the bundle background
were overlapping while the bundle is expanding. (only visible with
notificationRowTransparency() on)
2) There was a sync issue between the view system and Compose where
the header background would flicker for one frame when finish expanding.

Syncing Compose and View is rather complicated and this turned out to
be a simple fix instead. We always let the bundle show the header
background and let the children show their own background when
expanding (first issue).

Bug: 389839492 416520241
Test: Verified that the flicker is gone and during expansion none
of the backgrounds overlap.
Flag: com.android.systemui.notification_bundle_ui

Change-Id: I298f61649ead8e841c798a9b6ab67092be408faf
parent 67dc8e82
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -4090,7 +4090,14 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
     * Updates the parent and children backgrounds in a group based on the expansion state.
     */
    public void updateBackgroundForGroupState() {
        if (mIsSummaryWithChildren) {
        if (mIsSummaryWithChildren && isBundle()) {
            // For Bundles we let the BundleHeader show its background permanently. This is
            // possible because collapsed Bundles don't preview their children unlike summaries.
            // It is important that backgrounds don't overlap during expansion since
            // notificationRowTransparency() introduced transparency.
            mShowNoBackground = true;
            mChildrenContainer.updateHeaderForExpansion(mShowNoBackground);
        } else if (mIsSummaryWithChildren) {
            // With row transparency, a pinned notification should not hide its background.
            if (notificationRowTransparency() && isPinned()) {
                mShowNoBackground = false;
+0 −2
Original line number Diff line number Diff line
@@ -1416,8 +1416,6 @@ public class NotificationChildrenContainer extends ViewGroup
            if (expanded) {
                ColorDrawable cd = new ColorDrawable();
                cd.setColor(mContainingNotification.calculateBgColor());
                // TODO(b/389839492): The backgroundDrawable needs an outline like in the original:
                //  setOutlineProvider(mProvider);
                mBundleHeaderViewModel.setBackgroundDrawable(cd);
            } else {
                mBundleHeaderViewModel.setBackgroundDrawable(null);