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

Commit f7c77a3c authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge changes Ifac2b821,I80140e91,I255aa969,I2c372243

* changes:
  Fixed the clipTopAmount when transforming into the shelf
  Fixed the backgroundclipping with the clipbottom amount
  Improved the clipping of notification groups
  Fixed a bug with the maximum number of notifications
parents aac3cba5 7e7c6e2c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1685,6 +1685,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        if (mGuts != null) {
            mGuts.setClipBottomAmount(clipBottomAmount);
        }
        if (mChildrenContainer != null) {
            mChildrenContainer.setClipBottomAmount(clipBottomAmount);
        }
    }

    public boolean isMaxExpandHeightInitialized() {
@@ -1863,9 +1866,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            super.applyToView(view);
            if (view instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow row = (ExpandableNotificationRow) view;
                if (this.isBottomClipped) {
                    row.setClipToActualHeight(true);
                }
                row.applyChildrenState(mOverallState);
            }
        }
+7 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ public abstract class ExpandableOutlineView extends ExpandableView {
                outline.setRect(translation,
                        mClipTopAmount,
                        getWidth() + translation,
                        Math.max(getActualHeight(), mClipTopAmount));
                        Math.max(getActualHeight() - mClipBottomAmount, mClipTopAmount));
            } else {
                outline.setRect(mOutlineRect);
            }
@@ -66,6 +66,12 @@ public abstract class ExpandableOutlineView extends ExpandableView {
        invalidateOutline();
    }

    @Override
    public void setClipBottomAmount(int clipBottomAmount) {
        super.setClipBottomAmount(clipBottomAmount);
        invalidateOutline();
    }

    protected void setOutlineAlpha(float alpha) {
        if (alpha != mOutlineAlpha) {
            mOutlineAlpha = alpha;
+4 −7
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ public abstract class ExpandableView extends FrameLayout {
    protected OnHeightChangedListener mOnHeightChangedListener;
    private int mActualHeight;
    protected int mClipTopAmount;
    private float mClipBottomAmount;
    protected int mClipBottomAmount;
    private boolean mDark;
    private ArrayList<View> mMatchParentViews = new ArrayList<View>();
    private static Rect mClipRect = new Rect();
@@ -241,7 +241,7 @@ public abstract class ExpandableView extends FrameLayout {
        return mClipTopAmount;
    }

    public float getClipBottomAmount() {
    public int getClipBottomAmount() {
        return mClipBottomAmount;
    }

@@ -354,11 +354,8 @@ public abstract class ExpandableView extends FrameLayout {
    private void updateClipping() {
        if (mClipToActualHeight) {
            int top = getClipTopAmount();
            if (top >= getActualHeight()) {
                top = getActualHeight() - 1;
            }
            mClipRect.set(0, top, getWidth(), (int) (getActualHeight() + getExtraBottomPadding()
                                - mClipBottomAmount));
            mClipRect.set(0, top, getWidth(), Math.max(getActualHeight() + getExtraBottomPadding()
                                - mClipBottomAmount, top));
            setClipBounds(mClipRect);
        } else {
            setClipBounds(null);
+0 −1
Original line number Diff line number Diff line
@@ -156,7 +156,6 @@ public class NotificationShelf extends ActivatableNotificationView {
            mShelfState.alpha = 1.0f;
            mShelfState.belowSpeedBump = mAmbientState.getSpeedBumpIndex() == 0;
            mShelfState.shadowAlpha = 1.0f;
            mShelfState.isBottomClipped = false;
            mShelfState.hideSensitive = false;
            mShelfState.xTranslation = getTranslationX();
            if (mNotGoneIndex != -1) {
+1 −4
Original line number Diff line number Diff line
@@ -404,12 +404,9 @@ public class NotificationPanelView extends PanelView implements
                mKeyguardStatusView.getHeight());
        int notificationPadding = Math.max(1, getResources().getDimensionPixelSize(
                R.dimen.notification_divider_height));
        final int overflowheight = getResources().getDimensionPixelSize(
                R.dimen.notification_shelf_height);
        float shelfSize = mNotificationStackScroller.getNotificationShelf().getIntrinsicHeight()
                + notificationPadding;
        float availableSpace = mNotificationStackScroller.getHeight() - minPadding - overflowheight
                - shelfSize;
        float availableSpace = mNotificationStackScroller.getHeight() - minPadding - shelfSize;
        int count = 0;
        for (int i = 0; i < mNotificationStackScroller.getChildCount(); i++) {
            ExpandableView child = (ExpandableView) mNotificationStackScroller.getChildAt(i);
Loading