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

Commit eec182fd authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Set minimum height for NotificationChildrenContainer

This fixes an issue where we wouldn't have enough space to align the app
icon when the single line views were empty.

Bug: 429118181
Test: manual
Flag: com.android.systemui.notification_children_container_min_height
Change-Id: I8a97e096dc255299cb38b9efb1cb3bdef8767773
parent 4cb276b1
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -76,6 +76,16 @@ flag {
   }
}

flag {
   name: "notification_children_container_min_height"
   namespace: "systemui"
   description: "Enforce a minimum height for the NotificationChildrenContainer"
   bug: "429118181"
   metadata {
        purpose: PURPOSE_BUGFIX
   }
}

flag {
   name: "notification_ambient_suppression_after_inflation"
   namespace: "systemui"
+15 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import androidx.compose.ui.platform.ComposeView;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.widget.NotificationExpandButton;
import com.android.systemui.Flags;
import com.android.systemui.res.R;
import com.android.systemui.scene.shared.flag.SceneContainerFlag;
import com.android.systemui.statusbar.CrossFadeHelper;
@@ -828,8 +829,14 @@ public class NotificationChildrenContainer extends ViewGroup
        } else if (!childrenExpanded) {
            intrinsicHeight += mCollapsedBottomPadding;
        }

        if (Flags.notificationChildrenContainerMinHeight()) {
            // The height should at the very minimum be able to accommodate the header.
            return Math.max(mHeaderHeight, intrinsicHeight);
        } else {
            return intrinsicHeight;
        }
    }

    /**
     * Update the state of all its children based on a linear layout algorithm.
@@ -1616,8 +1623,14 @@ public class NotificationChildrenContainer extends ViewGroup
            visibleChildren++;
        }
        minExpandHeight += mCollapsedBottomPadding;

        if (Flags.notificationChildrenContainerMinHeight()) {
            // The height should at the very minimum be able to accommodate the header.
            return Math.max(minExpandHeight, mHeaderHeight);
        } else {
            return minExpandHeight;
        }
    }

    public boolean showingAsLowPriority() {
        return mIsMinimized && !mContainingNotification.isExpanded();