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

Commit ca27cf87 authored by Brandon Dayauon's avatar Brandon Dayauon Committed by Android (Google) Code Review
Browse files

Merge "hasBadge() in FastBitmapDrawable to check if badge exists." into main

parents 6eea7ceb 4a98c5b1
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();