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

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

Merge "Fix notification dot for predicted hotseat icons" into ub-launcher3-master

parents 8c6cff24 0ea7dddd
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);
        }