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

Commit 1f3f544f authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed more heads up bugs

Change-Id: Ibfb6656deb3bc588fc9292a672a5e4d4d1de4d23
parent d2281151
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -643,9 +643,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        }
        mMaxExpandHeight = expandedChild.getHeight();
        View headsUpChild = mPrivateLayout.getHeadsUpChild();
        if (headsUpChild != null) {
            mHeadsUpHeight = headsUpChild.getHeight();
        if (headsUpChild == null) {
            headsUpChild = mPrivateLayout.getContractedChild();
        }
        mHeadsUpHeight = headsUpChild.getHeight();
        if (intrinsicBefore != getIntrinsicHeight()) {
            notifyHeightChanged(false  /* needsAnimation */);
        }
+7 −13
Original line number Diff line number Diff line
@@ -51,8 +51,8 @@ public class NotificationContentView extends FrameLayout {

    private NotificationViewWrapper mContractedWrapper;

    private int mSmallHeight;
    private int mHeadsUpHeight;
    private final int mSmallHeight;
    private final int mHeadsUpHeight;
    private int mClipTopAmount;

    private int mContentHeight;
@@ -77,6 +77,8 @@ public class NotificationContentView extends FrameLayout {
    public NotificationContentView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mFadePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.ADD));
        mSmallHeight = getResources().getDimensionPixelSize(R.dimen.notification_min_height);
        mHeadsUpHeight = getResources().getDimensionPixelSize(R.dimen.notification_mid_height);
        reset(true);
    }

@@ -150,8 +152,7 @@ public class NotificationContentView extends FrameLayout {
        removeAllViews();
        mContractedChild = null;
        mExpandedChild = null;
        mSmallHeight = getResources().getDimensionPixelSize(R.dimen.notification_min_height);
        mHeadsUpHeight = getResources().getDimensionPixelSize(R.dimen.notification_mid_height);
        mHeadsUpChild = null;
        mVisibleView = CONTRACTED;
        if (resetActualHeight) {
            mContentHeight = mSmallHeight;
@@ -175,7 +176,6 @@ public class NotificationContentView extends FrameLayout {
            mContractedChild.animate().cancel();
            removeView(mContractedChild);
        }
        sanitizeLayoutParams(child, mSmallHeight);
        addView(child);
        mContractedChild = child;
        mContractedWrapper = NotificationViewWrapper.wrap(getContext(), child);
@@ -259,12 +259,6 @@ public class NotificationContentView extends FrameLayout {
        setClipBounds(mClipBounds);
    }

    private void sanitizeLayoutParams(View contractedChild, int height) {
        LayoutParams lp = (LayoutParams) contractedChild.getLayoutParams();
        lp.height = height;
        contractedChild.setLayoutParams(lp);
    }

    private void selectLayout(boolean animate, boolean force) {
        if (mContractedChild == null) {
            return;
@@ -337,8 +331,8 @@ public class NotificationContentView extends FrameLayout {

    private int calculateVisibleView() {
        boolean noExpandedChild = mExpandedChild == null;
        if (mIsHeadsUp) {
            if (mContentHeight <= mHeadsUpHeight || noExpandedChild) {
        if (mIsHeadsUp && mHeadsUpChild != null) {
            if (mContentHeight <= mHeadsUpChild.getHeight() || noExpandedChild) {
                return HEADSUP;
            } else {
                return EXPANDED;
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ public class HeadsUpTouchHelper implements Gefingerpoken {
                    mCollapseSnoozes = h < 0;
                    mInitialTouchX = x;
                    mInitialTouchY = y;
                    mHeadsUpManager.releaseAllToShade();
                    int expandedHeight = mPickedChild.getActualHeight();
                    mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight);
                    return true;
+7 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import com.android.systemui.EventLogTags;
import com.android.systemui.R;
import com.android.systemui.qs.QSContainer;
import com.android.systemui.qs.QSPanel;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.ExpandableView;
import com.android.systemui.statusbar.FlingAnimationUtils;
import com.android.systemui.statusbar.GestureRecorder;
@@ -1445,7 +1446,7 @@ public class NotificationPanelView extends PanelView implements
        updateHeader();
        updateUnlockIcon();
        updateNotificationTranslucency();
        mHeadsUpManager.setIsExpanded(!isShadeCollapsed());
        mHeadsUpManager.setIsExpanded(expandedHeight != 0);
        mNotificationStackScroller.setShadeExpanded(!isShadeCollapsed());
        if (DEBUG) {
            invalidate();
@@ -2153,6 +2154,11 @@ public class NotificationPanelView extends PanelView implements
        }
    }

    @Override
    public void OnHeadsUpPinned(ExpandableNotificationRow headsUp) {
        mNotificationStackScroller.generateHeadsUpAnimation(headsUp, true);
    }

    @Override
    public void OnHeadsUpStateChanged(NotificationData.Entry entry, boolean isHeadsUp) {
        mNotificationStackScroller.generateHeadsUpAnimation(entry.row, isHeadsUp);
+4 −0
Original line number Diff line number Diff line
@@ -1844,6 +1844,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        }
    }

    @Override
    public void OnHeadsUpPinned(ExpandableNotificationRow headsUp) {
    }

    @Override
    public void OnHeadsUpStateChanged(Entry entry, boolean isHeadsUp) {
        if (!isHeadsUp && mHeadsUpEntriesToRemoveOnSwitch.contains(entry)) {
Loading