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

Commit 5b154cee authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Translating the icon in the shelf with the notification" into pi-dev

parents 294ad785 143672c2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1558,6 +1558,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                }
            }
            invalidateOutline();

            // In order to keep the shelf in sync with this swiping, we're simply translating
            // it's icon by the same amount. The translation is already being used for the normal
            // positioning, so we can use the scrollX instead.
            getEntry().expandedIcon.setScrollX((int) -translationX);
        }
        if (mMenuRow.getMenuView() != null) {
            mMenuRow.onTranslationUpdate(translationX);
+6 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
    private boolean mAnimationsEnabled = true;
    private boolean mShowNotificationShelf;
    private float mFirstElementRoundness;
    private Rect mClipRect = new Rect();

    public NotificationShelf(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -672,6 +673,11 @@ public class NotificationShelf extends ActivatableNotificationView implements
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        updateRelativeOffset();

        // we always want to clip to our sides, such that nothing can draw outside of these bounds
        int height = getResources().getDisplayMetrics().heightPixels;
        mClipRect.set(0, -height, getWidth(), height);
        mShelfIcons.setClipBounds(mClipRect);
    }

    private void updateRelativeOffset() {