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

Commit 8a6c9425 authored by Shan Huang's avatar Shan Huang
Browse files

Switch from group background to children backgrounds when group expansion finishes.

Only do this for child rows not customizing its background color.
Will address the smooth fading of custom color backgrounds in follow up.

Bug:398951935
Test: atest ExpandableNotificationRowTest
Test: Expand a notification group, by clicking the expander or swiping.
Make sure there are no flickers.
Flag: com.android.systemui.notification_row_transparency

Change-Id: Id2cb41f7772efbf738ab155c6a99d8799f54b15d
parent 23c7418d
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.Rect;
@@ -3964,12 +3965,18 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            }
        } else if (isChildInGroup()) {
            final int childColor = getShowingLayout().getBackgroundColorForExpansionState();
            // Only show a background if the group is expanded OR if it is expanding / collapsing
            // and has a custom background color.
            if (Flags.notificationRowTransparency() && childColor == Color.TRANSPARENT) {
                // If child is not customizing its background color, switch from the parent to
                // the child background when the expansion finishes.
                mShowNoBackground = !mNotificationParent.mShowNoBackground;
            } else {
                // Only show a background if the group is expanded OR if it is
                // expanding / collapsing and has a custom background color.
                final boolean showBackground = isGroupExpanded()
                        || ((mNotificationParent.isGroupExpansionChanging()
                        || mNotificationParent.isUserLocked()) && childColor != 0);
                mShowNoBackground = !showBackground;
            }
        } else {
            // Only children or parents ever need no background.
            mShowNoBackground = false;