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

Commit e245241d authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge "[Minimal HUN] Use Heads Up Height for Minimal HUN" into main

parents cbf633f6 e9e91552
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1267,6 +1267,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
        if (mExpandedWhenPinned) {
            return Math.max(getMaxExpandHeight(), getHeadsUpHeight());
        } else if (android.app.Flags.compactHeadsUpNotification()
                && getShowingLayout().isHUNCompact()) {
            return getHeadsUpHeight();
        } else if (atLeastMinHeight) {
            return Math.max(getCollapsedHeight(), getHeadsUpHeight());
        } else {
+10 −2
Original line number Diff line number Diff line
@@ -207,6 +207,8 @@ public class NotificationContentView extends FrameLayout implements Notification
    private boolean mContentAnimating;
    private UiEventLogger mUiEventLogger;

    private boolean mIsHUNCompact;

    public NotificationContentView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mHybridGroupManager = new HybridGroupManager(getContext());
@@ -543,6 +545,7 @@ public class NotificationContentView extends FrameLayout implements Notification
        if (child == null) {
            mHeadsUpChild = null;
            mHeadsUpWrapper = null;
            mIsHUNCompact = false;
            if (mTransformationStartVisibleType == VISIBLE_TYPE_HEADSUP) {
                mTransformationStartVisibleType = VISIBLE_TYPE_NONE;
            }
@@ -556,8 +559,9 @@ public class NotificationContentView extends FrameLayout implements Notification
        mHeadsUpWrapper = NotificationViewWrapper.wrap(getContext(), child,
                mContainingNotification);

        if (Flags.compactHeadsUpNotification()
                && mHeadsUpWrapper instanceof NotificationCompactHeadsUpTemplateViewWrapper) {
        mIsHUNCompact = Flags.compactHeadsUpNotification()
                && mHeadsUpWrapper instanceof NotificationCompactHeadsUpTemplateViewWrapper;
        if (mIsHUNCompact) {
            logCompactHUNShownEvent();
        }

@@ -902,6 +906,10 @@ public class NotificationContentView extends FrameLayout implements Notification
        }
    }

    public boolean isHUNCompact() {
        return mIsHUNCompact;
    }

    private boolean isGroupExpanded() {
        return mContainingNotification.isGroupExpanded();
    }