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

Commit 143672c2 authored by Selim Cinek's avatar Selim Cinek
Browse files

Translating the icon in the shelf with the notification

It's possible that the icon is transitioning when a
notification is being swiped. We now translate
the icon with it.

Change-Id: I8d533b8402a934d108f57a22d2975b20774eff8e
Fixes: 72948017
Test: runtest systemui
parent 51856fde
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() {