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

Commit e9e91552 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[Minimal HUN] Use Heads Up Height for Minimal HUN

Fixes: 383472650
Fixes: 377441373
Test: Post minimal HUN notification and observe dismiss animation. HUN shouldn't jump to expanded view during dismiss.
Post minimal HUN in immerse mode, wait for dismiss and pull the shade. There shouldn't be any jump on the shade.
Flag: android.app.compact_heads_up_notification

Change-Id: I193ffeea56858091e740457c3951b63e3000dff7
parent 559895c2
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();
    }