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

Commit 4897f7bc authored by Andrew Cole's avatar Andrew Cole Committed by Android (Google) Code Review
Browse files

Merge "Removing AdaptiveIconDrawable Checks" into main

parents 940a9d18 cdfa5e6b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.launcher3.icons;

import android.content.Context;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;

@@ -75,7 +76,7 @@ public class LauncherIcons extends BaseIconFactory implements AutoCloseable {
    }

    @Override
    protected Drawable getMonochromeDrawable(Drawable base) {
    protected Drawable getMonochromeDrawable(AdaptiveIconDrawable base) {
        Drawable mono = super.getMonochromeDrawable(base);
        if (mono != null || !Flags.forceMonochromeAppIcons()) {
            return mono;
+6 −14
Original line number Diff line number Diff line
@@ -100,20 +100,12 @@ public class MonochromeIconFactory extends Drawable {
     * Creates a monochrome version of the provided drawable
     */
    @WorkerThread
    public Drawable wrap(Drawable icon) {
        if (icon instanceof AdaptiveIconDrawable) {
            AdaptiveIconDrawable aid = (AdaptiveIconDrawable) icon;
    public Drawable wrap(AdaptiveIconDrawable icon) {
        mFlatCanvas.drawColor(Color.BLACK);
            drawDrawable(aid.getBackground());
            drawDrawable(aid.getForeground());
        drawDrawable(icon.getBackground());
        drawDrawable(icon.getForeground());
        generateMono();
        return new ClippedMonoDrawable(this);
        } else {
            mFlatCanvas.drawColor(Color.WHITE);
            drawDrawable(icon);
            generateMono();
            return this;
        }
    }

    @WorkerThread