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

Commit 0ea7dddd authored by Samuel Fufa's avatar Samuel Fufa
Browse files

Fix notification dot for predicted hotseat icons

Bug: 148232056
Test: Manual
Change-Id: I34660eff089ce2f95ceebde143f22b1ef729ea09
parent 766a5d13
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView {

    private static final float RING_EFFECT_RATIO = 0.11f;

    boolean mIsDrawingDot = false;
    private final DeviceProfile mDeviceProfile;
    private final Paint mIconRingPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    private boolean mIsPinned = false;
@@ -80,6 +81,16 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView {
        canvas.restoreToCount(count);
    }

    @Override
    protected void drawDotIfNecessary(Canvas canvas) {
        mIsDrawingDot = true;
        int count = canvas.save();
        canvas.translate(-getWidth() * RING_EFFECT_RATIO, -getHeight() * RING_EFFECT_RATIO);
        super.drawDotIfNecessary(canvas);
        canvas.restoreToCount(count);
        mIsDrawingDot = false;
    }

    @Override
    public void applyFromWorkspaceItem(WorkspaceItemInfo info) {
        super.applyFromWorkspaceItem(info);
@@ -112,7 +123,7 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView {
    @Override
    public void getIconBounds(Rect outBounds) {
        super.getIconBounds(outBounds);
        if (!mIsPinned) {
        if (!mIsPinned && !mIsDrawingDot) {
            int predictionInset = (int) (getIconSize() * RING_EFFECT_RATIO);
            outBounds.inset(predictionInset, predictionInset);
        }