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

Commit 3ddda6dc authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a flickering of the icon when it goes into the shelf

We can adjust the Pivot such that the scaling doesn't happen
irregularly and that the animation is smooth.

Change-Id: Ib2e42a20430e1c10950a197a4c04e7c64c7dec67
Test: add notification, no flicker
Fixes: 80270979
parent d54c3a30
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
                mDarkAmount);
        final int outerBounds = mStatusBarIconSize;
        mIconScale = (float)imageBounds / (float)outerBounds;
        updatePivot();
    }

    private void updateIconScaleForSystemIcons() {
@@ -859,6 +860,12 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
            mLayoutRunnable.run();
            mLayoutRunnable = null;
        }
        updatePivot();
    }

    private void updatePivot() {
        setPivotX((1 - mIconScale) / 2.0f * getWidth());
        setPivotY((getHeight() - mIconScale * getWidth()) / 2.0f);
    }

    public void executeOnLayout(Runnable runnable) {