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

Commit 151aa566 authored by fbaron's avatar fbaron Committed by Federico Baron
Browse files

Add PreviewItemManager unit test to check if icons are themed when they shoudl...

Add PreviewItemManager unit test to check if icons are themed when they shoudl be in folder previews

Fix: 317417863
Test: PreviewItemManagerTest
Flag: NONE
Change-Id: Ie5769a4c96828b4dde8b33f15711c6ba025e9671
parent 44787ffd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -312,6 +312,11 @@ public class FastBitmapDrawable extends Drawable implements Drawable.Callback {
        updateFilter();
    }

    @VisibleForTesting
    public Drawable getBadge() {
        return mBadge;
    }

    /**
     * Updates the paint to reflect the current brightness and saturation.
     */
+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableWrapper;

import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.annotation.Nullable;

/**
@@ -54,9 +55,13 @@ public class UserBadgeDrawable extends DrawableWrapper {
    private final int mBgColor;
    private boolean mShouldDrawBackground = true;

    @VisibleForTesting
    public final boolean mIsThemed;

    public UserBadgeDrawable(Context context, int badgeRes, int colorRes, boolean isThemed) {
        super(context.getDrawable(badgeRes));

        mIsThemed = isThemed;
        if (isThemed) {
            mutate();
            mBaseColor = context.getColor(R.color.themed_badge_icon_color);
@@ -71,6 +76,7 @@ public class UserBadgeDrawable extends DrawableWrapper {
    private UserBadgeDrawable(Drawable base, int bgColor, int baseColor,
            boolean shouldDrawBackground) {
        super(base);
        mIsThemed = false;
        mBgColor = bgColor;
        mBaseColor = baseColor;
        mShouldDrawBackground = shouldDrawBackground;