Fix notification dot for predicted hotseat icons

Bug: 148232056
Test: Manual
Change-Id: I34660eff089ce2f95ceebde143f22b1ef729ea09
This commit is contained in:
Samuel Fufa
2020-01-31 18:09:48 -08:00
parent 766a5d1337
commit 0ea7ddddc5
@@ -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);
}