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

Commit 4a98c5b1 authored by Brandon Dayauon's avatar Brandon Dayauon
Browse files

hasBadge() in FastBitmapDrawable to check if badge exists.

Check badge if it exists by checking its creationFlags

bug: 299364813
Test: vids:
before: https://drive.google.com/file/d/1Gb_bV5oIEPAvNYnqMJwscX-r1iz967eY/view?usp=sharing
after: https://drive.google.com/file/d/1GTH1A8biVAVnWXaArMkdzWK9kiwFhVCn/view?usp=sharing
Change-Id: I1630d8ee8d38bcfdc76b702876dfdda80461a919
parent 7b1c0ff1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.launcher3.icons;

import static com.android.launcher3.icons.BaseIconFactory.getBadgeSizeForIconSize;
import static com.android.launcher3.icons.BitmapInfo.FLAG_NO_BADGE;
import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED;
import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;

@@ -338,6 +339,11 @@ public class FastBitmapDrawable extends Drawable implements Drawable.Callback {
        return getDisabledColorFilter(1);
    }

    // Returns if the FastBitmapDrawable contains a badge.
    public boolean hasBadge() {
        return (mCreationFlags & FLAG_NO_BADGE) == 0;
    }

    private static ColorFilter getDisabledColorFilter(float disabledAlpha) {
        ColorMatrix tempBrightnessMatrix = new ColorMatrix();
        ColorMatrix tempFilterMatrix = new ColorMatrix();